Heh heh, here comes the
crazy!
Optimization
To seriously optimize any level, we can take advantage of OpenGL display lists/vertex buffer objects and grouping.
The main bottle neck with OpenGL mode right now is that when in renders a map, it must first break up geometry into triangles.
This isn't anything unique to this game engine, but as it is right now, the Triangulation it uses isn't stable(misses polygons sometimes) and thus BSP holes can be generated accidentally. (This error is a combination of the engine's poor BSP system and using non GL friendly node builders)
The game must convert any sector's shape into triangles, example:
From this
To this
The so OpenGL must then renderer all these triangles EVERY FRAME and UNGROUPED.
This puts a tremendous stress on OpenGL as it renders things in the most UNoptimized way
What we can do is:
- Group the required triangles commands for drawing one sector into a unique display list http://www.songho.ca/opengl/gl_displaylist.html , or even better: vertex buffer objects http://www.songho.ca/opengl/gl_vbo.html
- We can do this at runtime ONCE and it might be even possible save this data to the wad file
- We then do this for entire sectors - we can then use the same vertex buffer object for the floor and ceiling if the planes are the same, effectively only needing to really draw both the ceiling and floor of a sector with one instruction
- We can even extend these vertex buffer objects for FOFS TOO since those can also share geometry with the sector below it, effectively removing render passes for many cases of sectors
-----
MORE CRAZY MAP EDITING:
Finer Slope Control
When UDMF is implemented, and since I now have access customizing a level editor - SRB2DB2 - we can modify the map editor to support PER VERTEX Z VALUES, which would make editing level geometry even more powerful - not to mention it would be possible to implement realtime previews with this new method of level design.
3D Obj Support
Another thing that would make sense between a fully implemented physics engine is to add support for Obj meshes - which are basically MD2 files but more powerful.
We could use these new obj files for any geometry in a level that's difficult to express using sectors or sprites, it's possible to implement editing for this in the map editor so a level can be fully previewed and worked on in real time
To ease organization, 3D models can be added to a wad file so the user doesn't have to go messing with a list of objects.
-----
These added complexities are just that - additions, the simplicity of the map editor and the core concepts are still there, which makes new features like this just a bonus for anyone who's already skilled in the current map format and editor.
An in-game auto-conversion for legacy SRB2 levels would definitely be another implemented feature which would allow users to enjoy classic SRB2 level in a new revamped engine without any extra effort on the user (or level designer's side)
These kinds of optimization and additions are cool for even more unrestricted level design/size and sector complexities, and this stuff is more than just random tests - this is revamping everything for
less creative restrictions when it comes to making levels and scripting new things. - It's essentially making a brand new, completely open source kind of 3D platforming game engine with an easy to use map editor!