Pages

Thursday, June 21, 2012

Day 3 - TechBlah

Stuff done under the hood not interesting to see in a video, so heres some text.

CONSOLE

Added a console to  allow me to input commands to help me find problems or test stuff.
EVEN BETTER GRAPHICS!!
- Wireframe : shows the world in wireframe. Useful to check the geometry is ok and to see through everything.
- Timescale : freeze, slow down or speed up the world physics and ai. Freeze in particular is very helpful, I can stop things from moving and go check a problem I spotted away with my magic flycam.
- Loadrange : allows me to change ingame the distance at which chunks are loaded/dropped. Good for stress tests or testing persistence.
- Fog : toggle fog on/off. I use fog in LoD computations, see below.

LEVEL OF DETAIL
LoD optimization is a classic in 3d computer graphics. The idea is that for a 3d object far from the player, you don't have to draw everything in detail. It doesn't have to have as much details as a mesh right under the player nose. This improves framerate and also may help fixing some display bugs. If done right the player won't notice the difference.
You can use this concept elsewhere. I use it on entities. The farther away an entity is from the player, the less accurate the physics and the ai is. I constrain the physics so while they are less accurate they do not become insanely un-physics.
I need this optimization as I want RS2 to have as much entities active as possible. Focus in RS2 is entities/actors, like RS1. Without LoD even with the simple random walker ai make the game crawl to 30fps when there is 1000 entities active. With entity LoD is a respectable 150-200fps.
I refined the idea by incorporating fog. Distance for LoD is measured relative to fog far range, as this is the farther the player can see. I will refine the idea further by using the camera frustum : low LoD for anything that is out of the player view cone. This should really help a lot. As long as my lolphysics don't break on low lod :(
I'm still not decided on what kind of lighting to use. Depending on that, I will or will not implement LoD on the cells (=3d tiles) mesh. Right now there is no LoD optimization on chunks, but there are already optimizations in the rendering such as octtree and texture batching.

WHY U 3D??
3D graphics for me is a mean to convey the gameplay and the atmosphere and not an end.
I don't go 3d realtime because it's cool or something but because it will allow me to do stuff I can't in turnbased 2D gameplay wise. Both are fine btw.

RS1? :(
Don't worry, again it's not dead until I say so. If it is, I'll release the sources.

End of post.

14 comments:

  1. Roguejacked, I am so happy to see you are still alive and kicking, and producing more wonderful content for all of us to enjoy. I have been peeking in at the RS1 blog every few weeks, and I had started to think maybe rs1 was going to stagnate again. I am SO psyched to see that you are creating rs2! I can't wait to see more!

    -Elisebambi :3

    ReplyDelete
    Replies
    1. <3 u 2. :D

      |> if you ever need anyone to do some, howyousay, testing, or, [s]getting to see stuff before everyone else[/s], I'm your gal! lol.

      Delete
  2. Do you mean in RS2 we will have "real" 3d, with for example a monster jumping from a room to an upper room ?
    Or a soldier aiming a zombie in the street from a more higher prospective?

    and more important.. player control is from first person view or third person ? (or both ? )
    it's all turn based or realtime ?

    ReplyDelete
    Replies
    1. Realtime 3d yes.
      1st person view will be the primary view. I need 3rd person for developpement, so maybe I'll let the player switch to it when he wants to.

      Delete
    2. Super fast reply! good :D

      do you have some resource for starting with JME? a simple project like moving actor, 3d collision set and so on ?

      Delete
    3. Mmh not that I can think of but they have a pretty good set of tutorials and samples:
      http://jmonkeyengine.org/wiki/doku.php/jme3#tutorials_for_beginners

      Delete
    4. It's too much stuff and start from too far. All i want is a moving cube into a plane with some other objects, any tuts about this?

      Delete
    5. I don't know. You could try their forums. But keep in mind jme3 is a scenegraph engine and even moving a simple cube might looks complicated.

      Delete
    6. @Marte, you'll need to start from the very beginning of the tutorials and work your way up for JME3. For everything you just described you'll need the beginning tutorials (creating the object, giving it texture, and then attaching it to the world+all the other wonderful stuff that you've gotta learn).

      You could try out Unity, another game engine, but I personally like JME3 better.

      Delete
  3. Hey :)

    Long time not seen. I'm glad you're still kicking. I have a few general / technical questions regarding the project, because I am curious.

    First of all, Java ? Seriously? Well, yeah I know it's multi platform, but still, a dying language is dying here (this is said from the point of view of a guy who is still coding in pascal object, so it can be taken with a grain of salt ^^).
    I am not expecting some state of the art graphical engine, but performance wise, I am wondering how well this stuff is doing. I'll have to wait for a video to judge i guess :)
    So yeah, is there a particular reason for that choice, other than the multi-platform stuff?

    Also, is this going to be RS in 3D or something sightly different? And as a follow-up, will the game still be sector based with approximate calculations for wtf is happening in other sectors every time the player change sector (that was kind of an immersion breaker for me in the previous game) or something a bit more, errr, "fluid" let's say.

    Also, if you need a pathfinder (i know that RS1 didn't need one per say as NPC had no plan or goal per say) algorithm, i'd strongly suggest you to give a look to this document:

    http://aigamedev.com/open/tutorial/symmetry-in-pathfinding/

    Cheers,
    SK.

    ReplyDelete
    Replies
    1. Java is multiplatform, it has been successfully used in commercial indie games, distribution is easy, its stable and performance is much better than you might think.
      If you want Win+Linux+Mac the other serious alternatives I can think of for 3d realtime are C/C++ with OpenGL and Mono with either OpenTK or MonoGame.
      I don't want to go back to C/C++ style languages and Mono is not mature enough, from what I see performance is not good enough on windows. It sounds to me its mostly for linux and mac, and then windows as a bonus.
      Personally I much prefer C# and XNA over Java and OpenGL, but it limits you to Microsoft universe.

      RS2 world is continuous, no loading or waiting screen, but under the hood the world has still to be cut into pieces, called chunks here. Being 3d realtime it will play differently from RS1 but the core principles are the same.
      BTW RS1 don't have has much "wait i'm simulating lol" screens anymore since version 8 iirc, it does most of the simulating while you play.

      Thanks for link, I follow this site too. The guy is obsessed with his behavioral trees thing but the free articles are pretty good. There was a pretty good video where he was submitted games by amateurs devs and analyzed how we would do the ai for them.

      Delete
  4. Anything that publishes under JME uses JAVA. As an example, 3079 uses jmonkey and I have to say that is a pretty amazing game. If I remember correctly it really didn't have to load between scenes (and I got into it about a year ago).

    I think both RS2 and 3079 have similar ideas in regards to graphics. I'd say go check out the free demo of 3079 for an idea of how RS2 'might' feel, with the understanding that 3079 is not about zombies and death is not permanent.

    ReplyDelete
  5. you didnt release the sources :(

    ReplyDelete