Terrain Research Infodump

Poll

Is the ability to modify the terrain midgame necessary for your projects?

Yes
No

Author Topic: Terrain Research Infodump  (Read 8637 times)

is it possible to overwrite the face culling routine? if so you can easily just assign chunk numbers to terrain and modify the routine so it checks only bricks within the same chunk. i dont know the inner workings so i dont know if its already optimized but if it isn't there's a thousand ways to make it faster

I believe that check may be the cause of lag as well.  I don't believe the act of hiding the face would cause any lag at all, but the act of checking a 64x160 cell face against another 64x160 cell face over many iterations, would.

Have you had problems w/chainkills destroying a piece of terrain, or do you have some method that allows people to build and delete on them without issues?
are you sure its the octtree face hiding that's causing the problems? cause default cubes dont have the same lag associated with removing large numbers, and they do proper face hiding too.

im almost 100% sure its related to what makes modter have better collision against vehicles, cause creating vehicle blocking objects appears to be expensive compared to just a normal .dts collision. or  maybe its just the fact it has such a large .dts collision, but then again there are multiple counterexamples for that.

are you sure its the octtree face hiding that's causing the problems? cause default cubes dont have the same lag associated with removing large numbers, and they do proper face hiding too.

im almost 100% sure its related to what makes modter have better collision against vehicles, cause creating vehicle blocking objects appears to be expensive compared to just a normal .dts collision. or  maybe its just the fact it has such a large .dts collision, but then again there are multiple counterexamples for that.
I am not sure that it is face hiding which causes the lag.  I am sure that placing large bricks right next to each other, does.
It took 7 minutes and 10 seconds to clear 65536 regular 64x cubes that were all touching.
It took only 7.11 seconds to clear the same number of 64x cubes that were not touching.

The .dts collision on modter does seem to impart some extra lag, but I have not observed the literal size of the collision objects causing any difference in the amount of lag they cause.


I reorganized and split up the code in my project.  Added some comments to help whatever poor soul tries to decipher this in the future.

not sure if this has anything helpful, but I got a slopes model in thanks to LegoPeppers and I added some collision to it meaning i would be able to drive, add bricks and etc. Only one issue..




there were holes in it every where... Not sure what causes this


not sure if this has anything helpful, but I got a slopes model in thanks to LegoPeppers and I added some collision to it meaning i would be able to drive, add bricks and etc. Only one issue..
[snip]
there were holes in it every where... Not sure what causes this
Interesting.  You could post that project here, perhaps it's fixable.

Interesting.  You could post that project here, perhaps it's fixable.
I lost the map,but I can easily replicate it. The funny thing is the more I split the parts, the more invisible parts show. And If i join all objects together then none show at all.. It was months ago so..
« Last Edit: May 22, 2018, 01:36:16 PM by datiel12 »

Check it out:





I generated it using a heightmap of lake taupo I found online.

Server_BrickTerrain
Remove the aaletsdodis.bls save file and load it ingame.


I've done some testing of this script on FlavouredGames server(UK).  It's definitely a big chore to make terrain with my script.
The last print used isn't inherited on the control bricks being placed.  Painting is a nightmare without the new duplicator to speed things up.  Coloring different levels of terrain looks terrible if it's not built in layers. It is incompatible with the new duplicator's duplication system.  Which is a bummer.  And the fillPrinter kicks out all sorts of errors into the console.  It lags for a large chunk of time when changes are made on a big piece of terrain.  And ghosting takes forever with large terrain as well.  Especially w/travel time.

I can fix the last print thing, easy peasy.  I planned to do it while making it, but I forgot amidst all of the other things. Done
I should make the quickloadTerray() function load the terrain with the modTer/BrickTOP texture. Done
I could modify the fillcan to work as if the terrain was a 2D plane, that would make painting much easier. Done [I also fixed painting undos]
I could try to make a patched version of the fillPrinter.  It shouldn't be spitting out errors like this.
I could try to fix the large change lag by making it take longer to fill out the megamap, but... that's not a good solution.  Get used to it, I say.
For ghosting, I will make a command to teleport a camera around underneath the map, just as an easy way to load the map without having to fly around.  The best solution for the ghosting problem, I have already outlined in this thread, but that is not being pursued in this current build.  Found port's GhostUtils(Download) and modified Server_BrickTerrain to work with it.  $Pref::Server::GhostAllAdmin = 0; & /ghostallbricks
It would also be nice to have a starting command.  It would load in a tiny bit of terrain, and place you next to the minimap.  In this way... it would not be required to find "0 0 0" and then figure out which direction is North-East so you can start building a minimap.
I would also like to modify the 1x1fControl bricks to be more recognizable.  It is easy to confuse them for regular 1x1f bricks.  However, I do not want to impact performance by doing this.  If I can get away with it, I would change the brick shape a little bit, give it a custom icon, and change the top texture to a modTer print. Done (omg it's so cute)

Coloring lines will still look super weird on improperly built terrain.
While could be possible to fix the new duplicator to work with the control bricks, I do not want to pursue this.

Currently, the best use of this mod, is to load in a heightmap, and then modify it via the minimap to fit your needs.
It is not advisable at all to build a map from scratch.

I definitely want to do some documentation.  I usually include an "info.txt" in the zip file with my add-ons.
But for this, a youtube video, and a screenshot tutorial would be very helpful for some people.


I wonder what the load time difference between a BRICK and a SPECIALBRICK is.
I can already tell you that the difference between a SPECIALBRICK and a SPECIAL is... a long time.  SPECIAL takes a long time to load.

...
For those of you who don't know:
BRICK is two lines, the brick size, and the fact that it is a BRICK type of brick.  All other data is automatically generated.  Most of the default bricks are made in this way.
SPECIALBRICK has the brick size, a collision box definition section, and then various sections for defining visual faces and whatnot.
SPECIAL is the same as the previous, except it also has a section for defining brick grid collision.  This is used on a brick like the 2x2 corner brick, so an additional 1x1f brick can be placed in the empty portion of the corner, even though it would technically be placed inside of the 2x2 corner brick's space.
« Last Edit: June 08, 2018, 08:22:55 PM by Tendon »



Download Server_BrickTerrain v0.2

Changelog:
Fixed printing to update lastPrintModTer field.
Fixed quickloadTerray() to load the terrain with modTer/BrickTOP by default.
Added support for FillCan to work better with minimap control bricks.
Added support for ghostUtils.
   Download GhostUtils here.
   Use $Pref::Server::GhostAllAdmin = 0; to allow all clients to ghost all bricks quickly.
   Clients should use /ghostallbricks to quickly load the entire map.
Modified Control 1x1f to look like a miniature modTer brick.
Added support for undoing FILLCAN and COLOR operations on Control 1x1f bricks.

Known issues:
   There is not support for undoing PLANT, PRINT, COLORFX, or SHAPEFX operations on Control 1x1f bricks.
   Print-gunning Control 1x1f bricks does not update the print on the Control 1x1f brick. (But it does change the megamap cell)
   Clearing all bricks at once will likely cause the the server to stop responding for a very long period of time on a large map.
      This will not be fixed until a version using StaticShapes for collision is implemented.


Because it can basically kill the server, it may be wise to stop /clearallbricks from affecting the terrain.
It's possible a more measured command could be made for clearing terrain, but if the command cannot clear the map faster than /clearallbricks, it would be basically useless to do so.
« Last Edit: June 08, 2018, 08:48:21 PM by Tendon »

Download Server_BrickTerrain v0.2.1

Fixed printing now actually printing the minimap brick.
Fixed GhostUtils support runaway loop (oops)


Bug: Deleting a cell does not update the cells around it.  This results in slightly different terrain when bricks are reloaded.
« Last Edit: June 09, 2018, 11:00:31 PM by Tendon »

Download Server_BrickTerrain v0.3

Changelog:
This version forsure forsure fixes GhostUtils support. (haha killme)
Added support for SelectiveGhosting.dll
   Uses StaticShapes for collision
      Only ghosts the StaticShapes near moving objects.
   Uses bricks which allow for MUCH faster clearing.


Optimization: Has some unneccesary shapefiles in there. [All CornerC, CornerD, and Wedge shapes aren't used.]
Bug: Deleting a cell does not update the cells around it.

I should add 5x, 6x, and 7x high cells to GhostTer.  To make terrain smoother.


empty room...
« Last Edit: June 16, 2018, 03:34:41 AM by Tendon »