Coder Social home page Coder Social logo

kf6kjg / anaximander2 Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 4.0 378 KB

Anaximander the Grid Cartographer is a map tile generator for Halcyon-based servers using C#, utilizing parallel processing and advanced tree data structures to generate only what is needed in as short a time as possible.

License: MIT License

C# 100.00%
map opensim opensimulator halcyon grid

anaximander2's People

Contributors

dependabot[bot] avatar kf6kjg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

anaximander2's Issues

As a user of the map it's disconcerting to see prims stop hard at the region-void boundary

When prims overlap the region boundary into void space they are cut off: no prims render beyond the edge of the region the prim is in.

Possible solution:
Void regions adjacent to existing regions should be considered as regions. This has to account for situations such as a void surrounded on all 4 sides and 4 corners with regions that have prims overlapping into the space. Solving this is doable, but might be complex. If accomplished, it would be a one-up - as long as it doesn't violate #4's disambiguation between water-only regions and void space.

As an observer of the resulting map I would like to see the colors of the prims show up better

Currently the prims are rendered using only the prim color: since most prims are colored white this means the maps are mostly just white.

This implies the following subtasks:

  • The ability to fetch the texture asset from the asset server.
  • The ability to determine a reasonable average color for the texture. - I think this one's got code in Halcyon that I can purloin.
  • The ability to cache the texture's UUID along with the resulting color information for fast subsequent lookups. This cache should have a disk-based backup to survive restarts.
  • The correct color-merge algorithm when rendering. SL merges the prim's color with the prim's texture, and Anax should do the same.

Exception crash when connection to WHIP fails

Exception: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.1.137:32700
at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port)
at System.Net.Sockets.Socket.Connect(String host, Int32 port)
at InWorldz.Whip.Client.RemoteServer.Connect()
at InWorldz.Whip.Client.RemoteServer.Start()
at AssetReader.AssetServerWHIP.Initialize(IConfig settings) in C:\projects\anaximander2\Source\AssetReader\AssetServerWHIP.cs:line 65
at AssetReader.AssetReader..ctor(IConfigSource configSource) in C:\projects\anaximander2\Source\AssetReader\AssetReader.cs:line 84
at Anaximander.Application.Main(String[] args)

As an observer of the map I see that some higher elevation prims are cut off at region crossings

This is due to a filter that limits which prims will be drawn based upon their height above the terrain in OBBRenderer.cs near line 320:

if (
	// skip prim in non-finite position
	Single.IsNaN(pos.X) || Single.IsNaN(pos.Y) ||
	Single.IsInfinity(pos.X) || Single.IsInfinity(pos.Y) ||

	// skip prim Z at or above 256m above the terrain at that position, but only if actually above terrain.
	// BUG: will still cause discrepencies when the terrain changes height drastically between regions and the prim is in the high "iffy" area.
	(pos.X >= 0f && pos.X < 256f && pos.Y >= 0f && pos.Y < 256f && pos.Z >= (MathUtilities.GetBlendedHeight(heightMap, pos.X, pos.Y) + 256f)))
	return null;

As noted this will only happen if the prim is near the terrain+256m altitude limit, overlapping into an adjacent region, and the terrain height in the adjacent region has an altitude change enough to invalidate the prim in that region's space.

To solve this the region would have to know the adjacent region's terrain.

Under Windows the asset cache cannot handle parallel operations

See https://rollbar.com/kf6kjg/Anaximander-2/items/47/

Preconditions:

  • OS is Windows
  • [Assets]:CachePath is set to an existing folder
  • [Startup]:MaxParallism is -1 on a multiprocessor or hyperthreaded machine, or is greater than 2.

Error:
The process cannot access the file 'C:\websites\newgrid\anaximander2\AssetCache\b8\d3\96\5a\ad\78\bf\43\69\9b\bf\f8\ec\a6\c9\75.pbasset' because it is being used by another process.

Possible solution: set some flag that results in FILE_SHARE_READ being used. http://stackoverflow.com/questions/3527205/multiple-threads-reading-from-the-same-file may be of service.

As a developer I want to find a good way to render 3D objects without a GUI

Requirements:

  • Headless operation: no dependencies on X11, no requirements to be on Windows, etc.
  • Render to image.
  • Non-commercial license.
  • Operates on Linux.

Would be nice to have:

  • Able to render without a GPU.
  • Able to render with GPU acceleration.
  • Operate on Windows.
  • Operate on MacOS.

Non requirements:

  • Doesn't have to render in realtime - though speed is a nice feature.

As an observer of the resulting map I would like to see the colors of the terrain match the custom texture layers

Currently the renderer assumes that all islands use the same base terrain textures. This is very much the same problem as #1.

This implies the following subtasks:

  • The ability to fetch the texture asset from the asset server.
  • The ability to determine a reasonable average color for the texture. - I think this one's got code in Halcyon that I can purloin.
  • The ability to cache the texture's UUID along with the resulting color information for fast subsequent lookups. This cache should have a disk-based backup to survive restarts.

RDB connect string is ignored if there is no RDB host mapping

If the RDB host cannot be found for a region, because there is no entry for it in the RegionRdbMapping table or no entry for that in the RDBHosts table, it should assume the same host as the core database. Anaximander does assume that, as far as I can tell. However, when it switches to use the core db host, it also changes the other connection string parameters to the core host connection.

Problem configuration:

MasterDatabaseConnectionString = "Data Source=db.host.com;Database=grid;User ID=..."
RDBConnectionStringPartial = "Database=grid_rdb;User ID=..."

Note that the Database= entries above have two different names.

The setup on Islandz is such that there is no RDB mapping but the database itself is named islandz_rdb. Anaximander correctly contacts (falls back to) the core database host, but when it does so it ignores the RDB-specific connection string in the Anaximander.ini RDBConnectionStringPartial setting.

Converting to .NET Core / 5 / whatever

This is going to be a bit of work. Several of the NuGet packages in use have died in favor of .Net built-ins. Conversions will be needed.

NuGet Packages

  • Nancy: everything it provided should be now part of .NET.
  • Trove.Nini: There's nothing in .NET. We should consider moving to a better config format, say YAML or TOML. I'm not a fan of XML configs.
  • LibreMetaverse: Exists in legacy .NETStandard. Should be usable.
  • NUnit: Exists in legacy .NETStandard. Should be usable.
  • RestSharp: Exists in legacy .NETStandard. Should be usable.
  • zlib.net: Needs replacement. It is suggested to convert to SharpZipLib.
  • Chattel: Needs an upgrade itself.

As a user of the map it's disconcerting to see region-crossing prims stop hard at the region-region edge

When regions are adjacent and prims overlap the region boundary they are cut off: no prims render beyond the edge of the region the prim is in.

Possible solution:
All 8 adjacent region's prims should be brought in to the list of prims for the current region and then filtered for intersection with the AABB of the region. Remaining prims are then drawn. This will solve the region-region primcrossing render oddity.

As a webadmin I'm concerned at what would happen if the file is changed while the webserver is reading it

Comes from this comment in Program.cs:

/* Issues to watch for:
* TODO: Tile image read during write - The web server could attempt to read a file while the file is being written.
*  - Possible solution: write to a random filename then try { mv rndname to finalname with overwrite } catch { try again later for a max of N times }
*    This should provide as much atomicity as possible, and allow anything that's blocking access to be bypassed via time delay. Needs to just fail under exceptions that indicate always-fail conditions.
*/

As a user I'd like to see the terrain details pop more (self shadow)

I had to disable the selfshadow code early on as it was badly messing up the coloration on land that was shallowly tilted towards or away from the light source.

3D rendering would likely take care of this, but there might be ways to get it back in operation without the odd effects.

Code is commented out near line 275 of OBBRenderer.cs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.