[dumb ZScript experiment] Daggerfall-like overworld map
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
[dumb ZScript experiment] Daggerfall-like overworld map
It's a huge map with 379463 trees sprawled across it. So wait, there's 300k Things on the map, how does it not slow down (too much)? The entire world is divided by imaginary "cells" and every time the player steps into a cell boundary, only trees close to the player are spawned. Also has sloped terrain made in Blender.
It's pretty much just a walking simulator at this point and there's no gameplay... and I don't know how much more will I tinker with this. I have no idea how to texture the ground and how to add towns because of the sloped terrain and - more importantly - since you are able to see the ENTIRE world with no 2-sided lines... attempting to add geometry into this will backfire very fast.
I guess it's just cool to be able to walk around in a world with 300k trees and see how laggy it could get, if at all.
Things you can try:
- "pukename tsc" in console to move very fast
- cl_foliagedistance to adjust the render distance (NOT spawn distance! this doesn't affect FPS too much)
- sv_foliagecellsize to set how large a cell size is. Use power of 2 numbers (512, 256, 1024 etc)
- sv_foliagecellmult determines how many more cells' worth of foliage is spawned in addition to the current cell. This was made so that when you're close to a cell boundary, you won't see an empty land then as soon as you step into the cell boundary, suddenly trees appear in front of you
The last 2 CVars would affect FPS more drastically than the first
Download -> https://www.dropbox.com/s/xbrylnhqbvwlx34/dag.pk7?dl=1
You do not have the required permissions to view the files attached to this post.
Last edited by Nash on Tue Feb 28, 2017 3:48 pm, edited 2 times in total.
-
- Posts: 2254
- Joined: Mon Jan 06, 2014 11:32 pm
Re: [dumb ZScript experiment] Daggerfall-like overworld map
It would be beyond amazing if someone could create an Elder Scrolls style mod, using a HUGE open world with quests and everything.
-
- Posts: 2024
- Joined: Sun Aug 22, 2010 10:59 pm
- Location: Tubarão, Brasil
Re: [dumb ZScript experiment] Daggerfall-like overworld map
I'd love to have something just like that in the time of my old artificial life experiment in DooM engine. *-*
Just imagine, a huge open world, free for the species to interact. I understand that for now the trees does not rly exist when player is in another "cell", but it could also just don't drawn the specimens far away AND let they live normally, invisibly. Thus, saving processing.
Just imagine, a huge open world, free for the species to interact. I understand that for now the trees does not rly exist when player is in another "cell", but it could also just don't drawn the specimens far away AND let they live normally, invisibly. Thus, saving processing.
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: [dumb ZScript experiment] Daggerfall-like overworld map
That's not possible, the CPU cost for an actor in a Doom map to exist doesn't go down just because it's invisible. The actor has to actually be destroyed from the map for it to not add up to the processing your computer needs. This is what I'm doing with the trees here. It's not enough to make them invisible, I actually have to completely remove them from the map when they're out of range, and re-add them when you step into a new cell.Ravick wrote:Just imagine, a huge open world, free for the species to interact. I understand that for now the trees does not rly exist when player is in another "cell", but it could also just don't drawn the specimens far away AND let they live normally, invisibly. Thus, saving processing.
If you thought NUTS.wad was crazy with ~10,000 actors in the map, this map shits over all that with roughly ~379,000 actors... >8D
-
- Posts: 28
- Joined: Tue Jan 10, 2017 12:11 am
Re: [dumb ZScript experiment] Daggerfall-like overworld map
You should add a few buildings to represent towns/villages, maybe that you could enter. I've seen some maps where you could do just that. Also, could you try making a ZDoom-friendly equivalent?
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: [dumb ZScript experiment] Daggerfall-like overworld map
Sorry, ZDoom has been discontinued and I don't mod for ZDoom anymore as it's severely outdated and lacking in modding features I need.
-
- Posts: 653
- Joined: Tue Jun 12, 2012 10:24 am
- Location: South Lake Hills
Re: [dumb ZScript experiment] Daggerfall-like overworld map
aaand I just remembered it doesn't work that way. Neat stuff, regardless.On adding more complex geometry, how hard would it be to make the ceilings of the cells lower so that the geometry isn't rendered?
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: [dumb ZScript experiment] Daggerfall-like overworld map
Believe me, I already tried that early on.
Generated an empty triangulated terrain in Blender, really large, has 1024 segments each, imported into GZDB, then lowered all the ceilings of every triangle except the one the player is standing in... I still get 5 FPS. :P
Generated an empty triangulated terrain in Blender, really large, has 1024 segments each, imported into GZDB, then lowered all the ceilings of every triangle except the one the player is standing in... I still get 5 FPS. :P
-
-
- Posts: 17906
- Joined: Fri Jul 06, 2007 3:22 pm
Re: [dumb ZScript experiment] Daggerfall-like overworld map
The BSP remains 2D (not 3D like in Quake) so differences in height will not have any effect on whether something will be processed. Only stuff behind single-sided lines will be fully skipped. Stuff hidden from player view by a lowered ceiling or a raised floor will still have an impact on performances.
-
- Posts: 344
- Joined: Thu May 07, 2015 4:24 pm
- Graphics Processor: nVidia with Vulkan support
- Location: New England Area, USA
Re: [dumb ZScript experiment] Daggerfall-like overworld map
Interesting little optimization. Makes me wonder about the possibility of a Doom-based "MMO"... It's always been a distant dream of mine to make such a thing. (Does it work in multiplayer?)
Another thing you could consider implementing: the original GTA was known for its huge cities filled with interact-able objects and cars, but in actuality the game only remembered the placement and condition of what the player interacted with, rather than keeping every single one in memory. I'm wondering if you could implement something similar - for instance, you could make the trees light on fire when the player shoots them and store it for later somehow...
Another thing you could consider implementing: the original GTA was known for its huge cities filled with interact-able objects and cars, but in actuality the game only remembered the placement and condition of what the player interacted with, rather than keeping every single one in memory. I'm wondering if you could implement something similar - for instance, you could make the trees light on fire when the player shoots them and store it for later somehow...
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: [dumb ZScript experiment] Daggerfall-like overworld map
I think I can improve the performance when stepping into a new cell by making it record which cell each tree belongs into, so when you step into a new cell, it will only load that cell's trees, instead of doing a ~379,000-step iteration every time the player steps into a new cell.
There will still be a massive lag when the map is first loaded though. I tried moving the trees out of the MAP WAD and made them pre-generated array assignments inside a ZScript source file but when I did that, GZDoom didn't go beyond the "Loading actor definition" stage so I had to leave the trees in the map WAD.
I tried doing that because with ~379,000 Things inside the map, GZDoom Builder eventually runs out of memory trying to save the map so it leaves little space left for placing other Things.
Ahhh well. This will forever remain a bunch of silly experiments I guess. No sane, playable project will ever be made this way. :P Perhaps this will forever stay as a Thing-count benchmark or something.
There will still be a massive lag when the map is first loaded though. I tried moving the trees out of the MAP WAD and made them pre-generated array assignments inside a ZScript source file but when I did that, GZDoom didn't go beyond the "Loading actor definition" stage so I had to leave the trees in the map WAD.
I tried doing that because with ~379,000 Things inside the map, GZDoom Builder eventually runs out of memory trying to save the map so it leaves little space left for placing other Things.
Ahhh well. This will forever remain a bunch of silly experiments I guess. No sane, playable project will ever be made this way. :P Perhaps this will forever stay as a Thing-count benchmark or something.
-
- Posts: 1318
- Joined: Tue Dec 06, 2016 11:25 am
Re: [dumb ZScript experiment] Daggerfall-like overworld map
Necro necro etc....
Since I have my Hunter TC on the backburner, and it also Features a massive open Terrain with trees and other features, I face the same issues. Maybe the initial map loading times could be circumvented by storing each tree Position (along with other Information) in a seperate file, even a zScript file, that is accessed when a cell is loaded. So there are actually no tree actors in the map when it is placed in the archive, they are spawned by referring to the separate file exclusively.
Since I have my Hunter TC on the backburner, and it also Features a massive open Terrain with trees and other features, I face the same issues. Maybe the initial map loading times could be circumvented by storing each tree Position (along with other Information) in a seperate file, even a zScript file, that is accessed when a cell is loaded. So there are actually no tree actors in the map when it is placed in the archive, they are spawned by referring to the separate file exclusively.
-
-
- Posts: 17454
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: [dumb ZScript experiment] Daggerfall-like overworld map
This is the wrong engine for this kind of thing. Forget it. :-)
-
- Posts: 1318
- Joined: Tue Dec 06, 2016 11:25 am
Re: [dumb ZScript experiment] Daggerfall-like overworld map
Why, though? There could be a global manager that has references to all the cell data instances and tracks player position. The cell data could just be a simple class.