Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Statics V3

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 5th Oct 2010 10:54
*These are not the GameFX Statics built into DBPro.

Statics were intended to be terrain eye candy (grass, flowers, rocks, etc.). However, as you will see, Statics have evolved to replace the terrain.

Statics are:

1) High detail: Eye candy!
2) Scripted: Easy to implement and edit + no need to re-compile
3) Painted: Easy to place 10's of 1000's using any paint program
4) Terrain enhancers: Turn flat terrain into living 3D
5) Terrain replacement: Statics V3 allows for full high-polygon collision and can replace terrain.

Demo attached: Give Statics a try and let me know what you think. I have a survey with SurveyMonkey here: http://www.surveymonkey.com/s/6YHZDT2

Some screen shots:





Attachments

Login to view attachments
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 12th Oct 2010 03:01
Had a go at the demo-- it was very nice! I liked the hole in the wall that led to the caverns. I never got to the end of those caverns though . I'm still a bit confused about what this is though. Are you just loading object locations from an image (which is very cool by the way), or is there something deeper that I'm missing here?

Also, when you load the objects from images, does it load one object per pixel?

Where are you planning on going with this? Do you plan to release some sort of function library?


Guns, cinematics, stealth, items and more!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Oct 2010 09:05 Edited at: 12th Oct 2010 09:13
Thanks for the feedback Sixty. I'm not entirely sure where this will go. At the very least, a function library and perhaps a 'Roguesque' 3D dungeon crawl... or perhaps more.

Yes, it is about placing objects (load, clone, and place) based on an image. Just draw the dungeon, city, building, landscape, whatever, on an n x n image and the library will take care of the rest. Creating a world becomes more art than coding at that point.

And it does go deeper than that. The "statics" are scripted, so adding models to a terrain is easy - no need to go "under the hood" much to create a game terrain. Again, this is a push towards art and away from the technical. The scripting allows for statics placed on, and angled with, advanced terrain (the caves are done this way). Inversely, a set height may be used, which is useful for water or buildings (the marble halls use this feature). To get that "cave in the corner" look, I simply matched the terrain height with the building height.

Other variable settings include object scale (default auto-scale is about 1.5 * (1/n * Terrain Size X), where n is the statics map image width and height, with some randomness thrown in to fool the eye), fixed or random y-rotation, and terrain angle resistance (the higher this value, the more horizontal the object is placed despite the terrain slope).

"Under the hood" there is a library of useful functions that can help interact with the terrain. The lava in the caves uses this functionality to display the word "Hot!" when over lava. This same functionality can be used to change sounds, like walking on gravel versus walking on grass. It could be used to give a player a speed advantage / disadvantage while on certain types of terrain, such as a road versus trudging through a swamp. It would be a simple task to code damage dealing to players walking though lava, or provide healing to players in a magical fountain, a temple, or an inn.

I suppose where I would like to start at, at a minimum, is something like David's Dice Game Challenge where a core set of default models are available for use with textures. All someone would have to do is change the textures, edit the script, and draw their own map. I even have a quick-and-dirty advanced terrain maker that can be easily used to create new terrains. No coding needed, an artist can do it all.

Here is an outdoor sample of what statics can do. This was done with Statics V2.





dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 12th Oct 2010 13:32
You really need to improve the brightness, this morning I could barely see anything in your screenshots and running it now it's like the player has several sunglasses on. Other than this, the scale was quite nice! I don't think I've seen any cave systems as expansive as these in other projects. However, while expansive, there wasn't much to see as it was highly repetitive, you should definitely add more random objects like gems or other things sticking out of rocks. Take a look at Oblivion for ideas, as their caves are pretty much randomly pasted in segments that look awesome.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Oct 2010 18:24
Thanks for the feedback Dark. Its funny you should describe the player as wearing sunglasses. A sphere is used for the player to handle collision. At first the sphere was hidden, but the caves were too bright (imo). By setting the sphere to visible, adding a black texture, and setting the alpha to 80, the caves became darker and gloomier: Basically - sunglasses.

Part of this demonstration is to show how the system can make a few objects look like a lot. I agree - the size of the caves does bring out the re-use of the objects. The forest scenes use about eight tree models and does a decent job of making a deep "random" forest. The caves only have three basic wall models and four basic floor models. Eight walls and eight floors would probably do the trick. Another feature I am changing is the Chance setting range for each model to be used is currently 1-100, which means the minimum chance is only 1%. In the forest example, this would be about one for every ten x ten area, which is about the range of the statics. The new setting will be 1-10,000. I might also consider just having the script accept a float value, which would be converted into a percent chance. The only problem with this is float accuracy drops off at smaller values.

As far as the expansiveness goes, the size is only about 1/100th of the statics map (take a look in the media folder). Using the colors on the map

@ This that filled out the survey - thank you!. The feedback is appreciated. If you have not taken the survey yet, please take a moment to complete the survey so both grouped feedback and individual feedback (provided here in the forums) can be collected. This will help set a focus on the more critical elements.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 20th Oct 2010 05:06
Re-Working the script format. I know the previous script was very cryptic. Any opinions or perspeectives on the following?


dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 20th Oct 2010 06:32
Why not use lua? Combined with LuaJIT it's the fastest scripting language there is and it's awesome(though I don't think anyone's made a DBP wrapper for the compiler).

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 21st Oct 2010 05:34
I've never tried Lua, so I realize I don't have a true comparison. IanM's Matrix Utilities, however, seems to be sufficient for this code - mainly a loading script. Since reading the script isn't done during the main loop, speed is not really an issue (or is it?).

This brings up a point I've been pondering: How would one use a script (actively) during a main loop. I can imagine some cases, like leaving a level and entering another, where a script would be used. However, I can't see how a script would be used consistently during a main loop for "game-play". About the closest I have figured is for loading quests or items from a script. But that is more like level-loading than game-play. Any other ideas I have come up with are silly, or at least impractical.
SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 21st Oct 2010 09:31
Looks awesome! Will it be free?
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 21st Oct 2010 09:51
In my latest projects I've been implementing an event-based system into most aspects of the engine through lua. A good example of its use was when I added my physics system; my main loop raises an event called 'onTick', which is called every loop and it passes the elapsed time for the previous loop and so I can bind custom functionality to occur every loop. At first I did the most basic:



which simply steps the physics every loop, but this isn't appropriate for accurate physics, so I later needed fixed-time-steps.

Which was added in no time without any recompilation:



This allows me to use the same game engine for different games as I can just choose to not include my 'physics.lua'(partially shown above), whereas normally I'd have to have two code bases for each project.

It pretty much allows me to make everything modular, as I have an '/autoexec' folder whose scripts get executed at app start, some other examples of scripts I can just drop into my game:

Screenshot key:


Automatically play and cycle through any music in the '/Music' directory:


Manage the rendering pipeline(I could later expand this to handle fullscreen-shaders):


And so on, my actual main loop code thus becomes ridiculously simple, it pretty much just calculates the elapsed time, raises the onTick event and checks for device loss and such. This makes debugging my code so much easier as I have much less to worry about.

My in game entities are virtually the same, you spawn one by name and it loads a script for it which can do nothing, or it can hook into various events and do something useful. Because the meat of how they work is in the scripts I don't have to store much information about them in my main engine, which means my data structures are far smaller and deleting entities isn't some complex process like it usually is.

entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 21st Oct 2010 11:56
Quote: "This makes debugging my code so much easier as I have much less to worry about."


I think this sounds like a half-truth, as it's more or less impossible to debug customized Lua in a good way, without writing your own debugger.

The method is really neat, but I'm personally not sure that moving functionality from a debuggable, compiled and fairly optimized environment over into Lua is the best way to do it.

Comes down to your preferred method, however. Event driven versus content driven versus procedural, etc. Yours looks like a really neat way to do the first.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 22nd Oct 2010 06:59
Quote: "The method is really neat, but I'm personally not sure that moving functionality from a debuggable, compiled and fairly optimized environment over into Lua is the best way to do it."


I wasn't at first either, which is why I originally only used lua to handle very basic things, but as I made more and more projects, more and more of my code was on the lua side.

But you're right about the debugging, when I hit an error I pretty much have to fix it then re-run until it stops breaking, but my scripts are now rather modular and each script is rarely more than 100 lines so I don't really come across issues that take more than a minute to fix.

The main reason why I use lua so heavily now is because it's sped up development time drastically, I still use C++ for the game framework and performance critical elements like particle effects, but being able to edit scripts and add new ones in with virtually no compile time(I precache all my 165 scripts which takes 250ms in debug) is like a more advanced form of edit-and-continue. Another amazingly useful feature is how easily you can serialize data, my save/load routines are just 1 function each, they take a table and just write all of its contents to a file and loading it is just as easy, doing the same in C++ is a pain in the arse.

entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 22nd Oct 2010 08:57
It's really interesting, though, as I'm currently working on a Lua implementation myself and haven't really come to a good conclusion on how to implement it.

Do you use modules/packages? I find them tremendously useful, for reusing Lua code.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 22nd Oct 2010 14:45
I use luabind to interface between C++ and lua and it's incredibly useful and pretty straightforward to use.

Quote: "Do you use modules/packages? I find them tremendously useful, for reusing Lua code."


Kind of, I use the basic approach, but looking at the other pages I may look into that some time.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 22nd Oct 2010 15:14
@Commico: Thank you. It will probably be free, whatever this turns out to be. More than likely this will end up as a set of tools and a library of functions with some type of demo game.

@Darkcoder: Thanks for the LUA script examples. If I can't use LUA with DBP, then I probably won't be using it (for a while at least).
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 25th Oct 2010 09:39
RiiDii: "Unity" is a fairly competent Lua package, actually. I used it a lot when I wrote stuff for DBP.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Oct 2010 03:03
I found Barnski's LUA plugin pretty useful as well:

http://forum.thegamecreators.com/?m=forum_view&t=74095&b=5


Guns, cinematics, stealth, items and more!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th Oct 2010 11:20
Thanks for all the LUA recommendations. I will look into LUA as time permits. In the meantime, any opinions on the script format presented earlier?
Dr Tank
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 30th Oct 2010 04:54 Edited at: 30th Oct 2010 04:55
This is cool. Like people say, it is pretty dark and a bit repetitive, but the caves have a nice organic feel and it is a big map.

I think for demonstration purposes the player should be able to walk faster and see where they are on the map. Also slightly less slippy slopey collision would be preferable, and mouselook. It's wierd when you're walking up or down a steep slope and can't see where you're going.

Anyway this seems like a cool thing and you could make something awesome with it with some more work.

BTW hold shift to walk on the ceiling!

Login to post a reply

Server time is: 2024-11-24 14:52:22
Your offset time is: 2024-11-24 14:52:22