binary zoo
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 18, 2018, 07:58:54 AM

Login with username, password and session length
Search:     Advanced search
30167 Posts in 1158 Topics by 194 Members
Latest Member: RobertHedge
* Home Help Search Login Register
+  binary zoo
|-+  Game Development
| |-+  Guest Dev Blogs (Moderator: JDog053)
| | |-+  TMC's - Old School RPG - Blog
Pages: [1] 2 3 ... 25 Go Down Print
Author Topic: TMC's - Old School RPG - Blog  (Read 42960 times)
T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« on: November 04, 2012, 10:34:32 AM »

First Post.

At the time of writing, this game has already been in development for several months.  Since about July actually.

I originally wrote a 3d landscape routine in Blitz3d and decided to write an RPG based around it.

This was a really cool system as i could dynamically create a landscape mesh around the player as he moved throughout the world.

But i soon hit FPS issues and eventually abandoned the technique as not being pratical.

I then tried several other languages and systems looking for something with a lot more speed so i could port across my landscape code.

This is where most of my time has been spent since starting the project.

I've dabbled in Blitzmax and OpenGL, Direct X and C++, Unity, Nuclear Basic, Dark Basic Pro, Dark GDK and Blitz3d.

All have their pro's and cons.

And after all that faffing about i've decided to go back to Blitz3d and restructure the RPG to run on that system.

Blitz3d is very slow when compared to something like Unity, but it's a language i know like the back of my hand and it will allow me to quickly get code written and tested.

My second choice would be Unity.  But i don't want to spend another 6 months learning the system when i could be writing a game instead.

The biggest problem i have with Blitz3d is it's speed and i wasn't sure if i could pull off a 3d RPG using it.

So i've recently been experimenting with various optimisation techniques trying to find a way to push a reasonable amount of polygons around to make a half decent looking RPG.

This has meant i've had to make some large compromises in order to keep the FPS up.  Even on my relatively quick PC.

The 3d terrain system has gone and is now replaced by a flat plane to represent the landscape.

This frees up a lot of FPS i can use for game world objects and other game related stuff.

It also means i can get away with flat planes for shadows.  Whereas with a 3d terrain, i would have had to use multi vertex planes aligned to the terrain.

A not very accurate system and very slow to boot.

But the experimentation has showed me that i can create an RPG if i can keep the polygon count down to around 2000 or so.

I have coded various detail level settings in the game so far, from max down to minimum for slower systems and the lowest detail settings still look pretty good.

If you remember games such a Daggerfall, ( the precursor to Morrowind, Oblivion and Skyrim ) then you'll get an idea of the type of game i'm going for.

I don't have any major story idea's yet as i'm concentrating on getting the game engine working first, but the game will be set in a medieval world, of warriors and mages ect with loads of dungeons, temples and castles to explore.


So, what have i got written so far.

The weather system is all complete.

Allowing for sunny days, overcast, rain, rain storms with thunder and lightning and snow and ice.

And are specific to Climate zones.

Ie, it never rains in the desert, but you do get sand storms there.
Jungles get a lot of rain.
Polar regions get alot of snow and snow storms ect.

I have 4 climate types so far.
Temperate = Green landscape with lots of vegetation.
Polar = Snow and ice
Tropical = Jungles
Desert = Desert Sand dunes ect


I've also coded a time and calender system.

The sun and moon rise and fall and are tracked across the sky and produce a light source for object shading.
The positions determined by the time of day.

I have 3 types of skyboxes for 3 different times of day.
Daytime Skybox
Sunset / Sunrise Skybox
Night Time Skybox

And all 3 fade in and out as the sun rises and sets.


I've also coded the cloud system.
The clouds slowly drift by and darken when overcast or for stormy weather.


I've also written a Tree system.

This creates and destroys tree billboards depending on how far from the camera they are and whether they are infront of or behind the camera.
Culling trees behind the camera cuts the polygon count for the trees by half for instance, so give large FPS savings.
I've also got Tree collisions written which allow for smooth sliding collision.

A similar system is used for grass which surrounds the player and for general in game objects.

Although Blitz3d allows 3d objects to be hidden in game and not rendered, they still do have a performance hit if they exist.
So, it's necessary to actually create and delete objects on the fly for increased FPS.

The screenshots below show the game in it's current state, using some placeholder graphics.

But you get the general idea of how the game will look and play.

TMC


* 2a.jpg (100.4 KB, 1024x768 - viewed 329 times.)

* 2b.jpg (194.75 KB, 1024x768 - viewed 315 times.)

* 2c.jpg (196.46 KB, 1024x768 - viewed 309 times.)
« Last Edit: November 09, 2012, 03:41:44 AM by T_M_C » Logged
T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #1 on: November 04, 2012, 10:35:17 AM »

Some more screenies.

TMC


* 2d.jpg (96.36 KB, 1024x768 - viewed 299 times.)

* 2e.jpg (232.36 KB, 1024x768 - viewed 320 times.)

* 2f.jpg (120.53 KB, 1024x768 - viewed 316 times.)
« Last Edit: November 05, 2012, 10:17:43 AM by T_M_C » Logged
T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #2 on: November 04, 2012, 10:35:49 AM »

Some more screenies.

TMC


* 2g.jpg (97.32 KB, 1024x768 - viewed 304 times.)

* 2h.jpg (165.56 KB, 1024x768 - viewed 307 times.)
« Last Edit: November 05, 2012, 10:17:16 AM by T_M_C » Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #3 on: November 04, 2012, 07:49:46 PM »

That's looking nice already.  Having day/night & seasonal cycles in there already shows decent progress.  I didn't think you were that far on.

So much work.  I'm shaking just at the thought of it. Smiley  Looking forward to following progress.

But the experimentation has showed me that i can create an RPG if i can keep the polygon count down to around 2000 or so.
Wow that is low.  Talk about setting yourself a challenge Smiley

It might not necessarily be a bad thing though especially if the plan is to create a lot of the media yourself.  Plus you can probably go for a slightly stylised look to avoid comparisons with other similar games. 


Are you intending to follow all the usual RPG standards for skills, levelling up etc or something a bit different?

Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #4 on: November 05, 2012, 12:13:00 AM »

Thanks Fog.

It's still very early days in dev and theres not really much i can show at the moment.

The game will look a lot better when i start writing the world builder and begin creating the world.

Quote
Are you intending to follow all the usual RPG standards for skills, levelling up etc or something a bit different?

I'm not sure yet.

I might use a standard D&D system as a general guide for my own system.

Character and enemy interaction will be done after the world builder stuff is complete, so it's some time off yet.

And i havn't given that much thought.

I expect i'll be using animated billboards for all the enemies and characters though.

TMC

Footnote
-------------
Looking at my screenshots again i realised my shadows were missing.
I totally overlooked the fact when posting.   Tongue
And it turns out i forgot to remove a variable that prevented the shadows from showing.
Bug now fixed and 've now amended the screenshots to include the shadows which looks a lot better.
« Last Edit: November 05, 2012, 10:22:46 AM by T_M_C » Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #5 on: November 05, 2012, 12:03:18 PM »

Footnote
-------------
Looking at my screenshots again i realised my shadows were missing.
I totally overlooked the fact when posting.   Tongue
And it turns out i forgot to remove a variable that prevented the shadows from showing.
Bug now fixed and 've now amended the screenshots to include the shadows which looks a lot better.
That's made a big difference.  Doesn't look anywhere near as flat as it did before.

I expect i'll be using animated billboards for all the enemies and characters though.
Nice.  Could give that more distinctive look.  IMO Doom 1 with more animation frames would look preferable to the meh Doom 3....but that's me  Tongue

You've inspired me to discover how to do a really quick pixelated effect. Thanks lol Smiley



* pixel_dwarf.png (42.32 KB, 200x200 - viewed 294 times.)
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #6 on: November 06, 2012, 05:54:28 AM »

Thats a cool looking Pixel Dwarf.   Cheesy

How did you pixelate it.

I'm guessing a Photohop / Paintshop Pro filter ?

TMC
Logged
JDog053
Moderator
1000 XP
*
Offline Offline

Posts: 2420


View Profile
« Reply #7 on: November 06, 2012, 06:22:58 PM »

This project looks great Masked, keen to see how it pans out! Smiley
Logged
T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #8 on: November 07, 2012, 05:20:29 AM »

Thanks Jdog.   Cheesy

Update
----------

I was thinking about what to do about implementing collisions.

I already have sliding collisions for the trees written which uses simple circle to circle distance checks which produces really nice sliding contacts and i was going to implement sliding collision for other geometry too.

And after going through all the pros and cons of writing my own system i suddenly thought, why don't i use a physics engine instead.

Letting the physics engine take care of all the collisions would make things a lot easier and also allow for physical interations if i want them.

So i spent all day yesterday implementing the ODE physics engine wrapper for Blitz 3d.

It's the same system i used for Auto Cross Racing.  Which although looks like a 2d game, viewed from above, is actually all 3d.

ODE (open dynamics engine) works in 2 stages.

Geoms and Bodys.

Geoms are the collision geometry and are things like, boxes, sphere and cylinders ect.

And the body's are physical properties, such as, mass, velocity and position.

And you create both seperately and attach them together to make a physical object in the game world that can interact with other objects.

But to see the object in game, you usually have to position and align a visible 3d mesh to the physics object.

And as the physical object moves and tumbles in the game world, your visible 3d mesh does also.

So, this is what i've done for my camera (although theres no visible 3d mesh)

The ODE camera is a physics sphere which i move in the game world and the Blitz3d camera is attached to it.

I can free mouselook the camera and move it's physics object in the direction the camera points.

ODE also lets you place non moveable physics objects in the game world by just creating geoms without assigning body's to them.

So this is what i've done to my trees.  I don't want the trees to move around for instance and most, if not all other world geometry will also be immovable.

Update the physics engine in my main loop and i'm good to go.

With camera to tree collisions working automatically.

Also added camera jumping as well by adding a vertical force to my camera object.

This all works really well except for a couple of small issues i've yet to resolve.

If i'm close to a tree and touching it, i can continuously keep jumping up the tree until i reach the top, then fall off.   Tongue

It might work as an undocumented game feature.  Tree climbing.   Grin

And iv'e also got a double jump bug going on which i havn't tracked down yet.


One issue i was worried about implementing a physics engine was the performance hit it usually gives.

I had big issues with Auto Cross Racing.

Originally all the cars had suspension and could flip and roll but the fps was so bad i could only render 2-3 cars.

The final game has 20 cars and are just sliding boxes.


So, i wrote a culling system similar to my trees, which creates and destroys the tree geoms depending on how close they are to the camera.

No point testing for tree collisions that are nowhere near the camera.

And with a test landscape of 1000 trees, only 3 to 4 of the nearest trees to the camera needed the geoms to be created.

So at the moment theres virtually no performance hit at all.

Making for a very happy TMC.   Grin


TMC
« Last Edit: November 07, 2012, 10:25:11 PM by T_M_C » Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #9 on: November 07, 2012, 12:57:16 PM »

Thats a cool looking Pixel Dwarf.   Cheesy

How did you pixelate it.

I'm guessing a Photohop / Paintshop Pro filter ?
In 3 steps in Paint Shop Pro 7.  (Duplicate layer, apply sculpture filter, use as darkening layer) There's probably a real easy way to do it now, but I love my 10 year old software Smiley


Hey you could climb trees in Mario64 so why now.  It's a good thing IMO.  Climbing trees is a fairly reasonable thing to do, could add some strategic possibilities and lets be honest, messing around with physics in games is what makes a lot of them fun.

Performance tests sound good.  It's cool that old coders tricks like culling systems still have a place in a world of super fast computers.  Similarly 2D tilemaps still throw up the same issues they did years ago.
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #10 on: November 07, 2012, 10:18:32 PM »

Quote
In 3 steps in Paint Shop Pro 7.  (Duplicate layer, apply sculpture filter, use as darkening layer) There's probably a real easy way to do it now, but I love my 10 year old software

A cool.

A "sculpture filter", i've never used that.   Smiley

Thats useful to know.

My favourite art package is Paint Shop Pro v6.

I just love the interface.  It's so quick and easy to use.

And if i need more features and alpha editing i use Photoshop cs2.

If i can't do what i want in PSP i fire up Photoshop.   Roll Eyes


Update
----------

Today has been spent bug squishing.

The double jump bug was because for a few frames after the initial jump impulse to start the camera jumping vertically, the ODE physics engine was still registering the camera geom as colliding with the ground.

And i was assuming that there was no contact with the floor as soon as the camera starts jumping.

The solution was to put a small delay into the code that prevents checking for a jump after the initial jump to give the camera geom enough time to clear the ground plane.

That had me scratching my head for a while though, as the code looked correct.



Also corrected a small bug that moved my clouds at breakneck speed whenever the camera moved.

Just a consequence of implementing the new physics system.


Created a player shadow too.
Not sure how useful it will be.
But it's there if players need to see where they are.  Perhaps to help accurately judge jumping gaps.


I've also coded a system now that lets me check specific geoms for camera collision.

I can query ODE for a list of all the geoms that the camera geom is currently colliding with and i stick all of these into an array each frame for collision checking.

This means i can selectively test for camera collisions now.

I also create a list of the nearest tree geoms for testing camera collision with.  And this allows me to climb trees.  Which is suprisingly fun and could lead to some interesting puzzles.  Climb a tree to get into certain areas.

If i don't want to be able to climb castle walls for instance, or maybe i do,  Cheesy, this system allows me to climb certain objects (by jumping when in contact) and not others.

TMC

Screenshot - ODE Physics Test


* ode_physics_test.jpg (212.18 KB, 1024x768 - viewed 297 times.)
« Last Edit: November 08, 2012, 05:21:16 AM by T_M_C » Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #11 on: November 08, 2012, 08:54:30 AM »

My favourite art package is Paint Shop Pro v6.

I just love the interface.  It's so quick and easy to use.
Likewise with v7.  For what I do it works brilliantly with non of the bloat later versions had.  I'm getting a Mac and will be putting Windows on it just so I can run Paint Shop.


That had me scratching my head for a while though, as the code looked correct.
We all know that feeling lol.  I wasted a good hour the other night trying to track down a bug only to realise the code was actually fine and it was what I was expecting it to do that was wrong.  Bug hunting for a none existent bug was a new low  Tongue


Created a player shadow too.
Not sure how useful it will be.
But it's there if players need to see where they are.  Perhaps to help accurately judge jumping gaps.
Shadows are really underused in most games, especially stealth sections.  Stick a hidden dummy object at the end of the shadow and even if the player is hidden if the enemy can see the dummy object, and therefore the shadw, it investigates.  No shadows at night, no dummy object, genuine cover of darkness stealth.  Sorted Smiley


And this allows me to climb trees.  Which is suprisingly fun and could lead to some interesting puzzles.  Climb a tree to get into certain areas.

If i don't want to be able to climb castle walls for instance, or maybe i do,  Cheesy, this system allows me to climb certain objects (by jumping when in contact) and not others.
Neat.  Speaking of castles have you had any thoughts on indoor areas yet?  I'm guessing caves and dungeons are essential to any RPG Smiley

Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #12 on: November 09, 2012, 03:32:25 AM »

Quote
Neat.  Speaking of castles have you had any thoughts on indoor areas yet?  I'm guessing caves and dungeons are essential to any RPG

Not really.

But dungeons and caves can be arbitrary meshes, not restricted to a flat ground like the outdoor sections, but with slopes and undulations, given that they are indoor enviroments with relatively short draw distances.

So, i should be able to create some interesting looking dungeons and caves.

Not sure what to do about inside buildings though.

I don't really think theres much point in making 3D interiors to walk around for all buildings.

Maybe for Taverns and quest specific locations.

It all depends on how much media i want to make.

As it could be very time consuming for a one man outfit like me.


Update
----------

I've been investigating some features of the physics engine as regards performane optimisations.

ODE allows the physics objects to reside in their own local space and sub-spaces.  Sort of grouping objects by type.

And various collision modes can be set to enable or disable space to space collisions.

As stated before, i don't need to know if trees can collide with each other for instance, as they don't move, so it makes sense to put them into their own local space and disable the internal space collision mode for them.
And since the tree space is a sub-space of the top-level-space which my camera occupies, it means my camera can still collide with the trees, but that tree to tree collisions are ignored by the engine.

And infact i've gone a step further by using two sub-spaces.

One which allows the camera to jump from /climb on objects and another that doesn't.

And i can simply test which space a geom resides in with one command to know if the camera can jump from or climb the object.

And hopefully this system should provide some much needed speed optimisations.


I've also used a technique called 'composite objects' for my camera.

This allows me to join several geoms to one physics body.

I found that using one fairly large phsyics sphere for my camera didn't allow me to squeeze through small gaps.
Felt like my camera / player was really fat, because it was quite high and just didn't feel right.
I wanted to use a vertically stretched sphere to give me the height i needed but also small enough to squeeze through small gaps, but ODE and Blitz3d for that matter doesn't support such an object.
Therefore i've used three small spheres stuck on top of each other to give the same effect.
This works really well and i consider the bottom sphere the players feet, the middle sphere the players body and the top sphere the players head.
Makes a lot of sense now and works really well.
I wrote a small 3rd person camera routine to see the three spheres move about the game world and test it's interactions and it all feels correct now allowing me to squeeze through relatively small gaps whilst still retaining the correct height.


Next thing to code are the general 3d world objects.

It will be a more advanced version of my trees code which will allow me to place a large variety of 3d objects in the game world.
But these obejcts will support multi geoms for the collision system so it adds to it's complexity.

I'll probably write an editor that allows me to import a 3d model and position and align the physics geoms and then save the data to a 3d object library, which can be used to load in the 3d game ready models .

TMC
« Last Edit: November 09, 2012, 03:36:20 AM by T_M_C » Logged
fog
Zookeeper
1000 XP
*
Offline Offline

Posts: 13178



View Profile WWW Email
« Reply #13 on: November 09, 2012, 12:18:23 PM »

Cool stuff.  Love hearing all the technical details.  I can't wait to try Box2D in AGK.  Physics is the one thing I've been tempted to play around with just for the hell of it.

Building interiors are a terrible time sink.  For the limited time some are seen it's crazy and unless you spend ages on them then they never look as great as the outdoor vistas do. 

Me being a lazy sod I'd have a story where everyone lived in a central castle, the only proper building in the land.  They then venture out into the wilderness, kill beasts and search caves etc, collect resources (minecraft style).  The further away from the castle, the better the resources but the harder the enemies.  Actually I need to do a shmup like that  BunnyMonkey!
Logged

T_M_C
1000 XP
*
Offline Offline

Posts: 3000

TMC


View Profile Email
« Reply #14 on: November 10, 2012, 04:52:15 AM »

Quote
Me being a lazy sod I'd have a story where everyone lived in a central castle, the only proper building in the land.  They then venture out into the wilderness, kill beasts and search caves etc, collect resources (minecraft style).  The further away from the castle, the better the resources but the harder the enemies.  Actually I need to do a shmup like that


Cool, sounds more like a strategy game than an RPG though.

Although both genres cross over so much these days sometimes it hard to make the distinction.


Quote
Cool stuff.  Love hearing all the technical details.  I can't wait to try Box2D in AGK.  Physics is the one thing I've been tempted to play around with just for the hell of it.

Yeh, it is loads of fun just messing about with the physics, when it's working correctly.

I think i've invented a new game.  Tree Billiards.   Tongue

Spent ages yesterday just running around kicking spheres and watching them ping off the trees.   Grin


Update
----------

Spent a frustrating day yesterday as i spotted a bug with my camera objects.

They seemed to have spongy collisions with the trees.

Further investigation revealed i had caclulated the wrong visible mesh sizes for the trees.
The ode mesh sizes are different to the Blitz3d mesh sizes.
Some meshes are twice the size, others like the cylinders have the same radius but double the height.   Tongue
So i spent some time double checking i had all the size converstions correct.

Then further investigations revealed that my composite camera spheres wern't registering proper collisions because i was forcing them all to stay upright, by resetting the angular velocities and rotations to 0 each frame.
And for some bizarre reason this made the collisions really spongy.

I tried all sorts of solutions but could't get it to work that way.

So in the end i scrapped it and reverted back to one sphere for the camera, which isn't forced to stay upright as it just rolls around the landscape.
This does provide proper accurate collisions as the sim isn't forced into doing something it doesn't want to do.
And i place the camera a small distance above the sphere.
This gives more or less the same effect as my 3 spheres, so overall it's not a bad solution.

I also re arranged and modified a lot of the variables.
Re arranging the data structure for a lot of routines.
Which took ages and then needed debugging.   Tongue

TMC
« Last Edit: November 10, 2012, 04:56:28 AM by T_M_C » Logged
Pages: [1] 2 3 ... 25 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!