Worklog for (tu) sinu

3d platformer engine

Return to Worklogs

latest(Posted 2007-09-29)
ive still been working on this every now and then, just don't get much real time. Glad that i still know what im doing though as i haven't checked the code for a while.

I need to start doing a quest system, dialogue system etc for this to be a capable game editor/engine, think thats what is planned next.


Doing tools etc(Posted 2006-11-23)
Im starting/doing some tools for interaction with game objects which make it easier for setting up player to active object interaction.
These let me work out where the player can/should be around a chest for example to activate it and then move to the correct position and then kick of the chest open animation and based on the type of chest, the players chest open animation.
This is allowing me to have proper interaction with all active game objects ie doors, chest, levers etc where the player will actually open/close them, or pull switches like in games such as zelda.


huge leaps...(Posted 2006-08-25)
I woke up the other day from a heavy drunken night out and i had an awesome brain wave!!

For the next 3 days i rewrote everything, from the entity systems, to the scrpting functions to how the engine and game worked and i now have a thing of beauty in front of me.
Thats about 40hrs of coding!!
I'll show it off soon :)


animations(Posted 2006-08-20)
Have got animated entities saved now, you can now just save the whole 3d scene and reload it exactly where it left off. I still need to add support for the reloading of ping-pong animations. Should be easy though.


added save/loading(Posted 2006-08-19)
Been fixing up the save/load system and adding it to the engine, you can now have an animating entity and when you load a save the anim will be playing from the exact same position you left of allowing to save exactly how you left off!


copyentity(Posted 2006-08-11)
phew, just got this done, was a pain to copy a entity and all userdefined children eg entityparent sword,hand. then save it and reload it but now i got it working.

You can also do a recursive entitycolor/entityalpha/scaleentity now so all userdefined children will be affected or not.


almost done entity part..(Posted 2006-08-10)
I have nearly wrapped all blitz3d's entity functions so you can now create entities, scale, rotate, color, alpha etc, save them to file and then restore the 3d world to where it was before.

Works with cameras, lights, pivots and all mesh types so far, need to add sprites and some libraries ie single surface etc.

Also done the scale/alpha etc for children and finished the reloading of hierachies the user creates.

id say i was about 75% done.


seperating game from engine..(Posted 2006-08-10)
After a lot of reading and more learning, im understanding alot of wrong things i had done by having game relevant stuff in the engine.
I have now totally removed it all now so it is like a basic game engine with nothing else, you have to do everything gameplay related in the scripting.

This allows a ton of freedom and ease of use.
All stuff like collisions and response is still engine specific as it avoids the user having to mess with all the hard stuff ie creating a character and getting world responses, with user tweaking still an option.

Now i can create scripts for things ie 3rd person cameras etc and allow them to be used without having to hardcode them.


day 1(Posted 2006-07-25)
Started work on a new 3d tile engine which will allow upto 500*500 grids of 3d tiles each 1 unit width/depth, u can have 1000*1000 at good fps but takes forever to load and unload and memory usage is monsterous!

It'll work like any 2d map editor except it will be fully 3d.
You setup the map size then paint down textures onto tiles, raise/lower them or just raise edges/corners to give more variety.

So far it's pretty basic but im working on it and am gonna use it for my game engine now.


early progress..(Posted 2006-07-10)
One thing that alot of new users have trouble with is a save/load system for their games, so i decided to code a system that will save out all blitz entities and restore them exactly how they were on saving ie colors, alpha, hidden etc.
The system builds on blitzs and allows creation of new entities and loading and unloading them along with deleting and hiding them.

The system is rapidly growing and although has many bugs works pretty well.

Im just trying to implement restoring of an animated mesh with the correct animation and frame and running of exactly from the last frame it was saved at.


Revamp..(Posted 2006-06-03)
Done some more reading up on oop and obp.
I've been concenrating on get my code neater and more efficient and have given everything a major revamp.

All entities in the engine are used in a object-based style and now it has made everything simple.

Im using a blitz style entity system but have expanded on it.
You can create lights, cameras and pivots similar to blitz but now have new types such as characters, doors, houses/buildings, placeables have been added.
This allows proper freedom from the restrictive way i had before.

The benifit is you can create a character entity as part of your own type group instead of being limited.

;a user created type
;which allows what you want
Type TMonster
 field name$
 field age%
 ;the 3d entity for your monster
 field model.TEntity
end type

Then you would do this

ThisMonster.TMonster = new TMonster
ThisMonster\name$ = "warlock"
ThisMonster\age% = 192
ThisMonster\model = NewEntity_Character.TEntity("warlock");sets up a default character TEntity
Load_Entity(ThisMonster\model);load the entities 3d stuff
Scale_Entity(ThisMonster\model,1,1,1)
Rotate_Entity(ThisMonster\model,0,90,0)


Now, why is this so great? Well, all you need to do for a character in your game is that, no messing about setting up collisions, animations, children etc
You have a predefined n/pc, now give it some ai/input and of you go.
You can also load/unload each entity at will


another break through(Posted 2006-05-23)
After hours of headaches i finally made another break through.
I already had edge climbing in but it was hacked because of how animations work in blitz where if you translate the entities origin in the 3d app it would always snap back to the original position at the end of the frame to the start frames origin.
Now it works great, if you grab an edge you climb it ala zelda/mario and position perfectly at the top of the edge!


Just changed the collision setup(Posted 2006-05-20)
Previously you had to name each part of the level as ground, wall etc and assign it a collision group but now you can just create one mesh for the level and all collisions and responses will work thanks to some clever work arounds and checks.

Any surface that has a walkable norm value will auto become ground, any surface that has a wall angle norm will become a wall.

This new way has also allowed my edge grabbing engine to work much better, any edge that looks grabbable can be automatically!


collision responses(Posted 2006-05-18)
I've implemented a great collision system, i think everyone will be impressed with how it reacts, from my character grabbing onto ledges to falling of a wall correctly.


progress report(Posted 2006-05-16)
Well i have made alot of progress to the base engine, i've recoded stuff, changed stuff and added stuff.
I've revamped the character engine part and made it even simpler to use. You can change alot of the way a character feels and moves ie you can create a little nimble dude like mario or a big slow beast like bowser, it's simple!!

Been working more on parts of the editor too and have the framework complete, now im adding stuff for character creation.

The actual way you create a character will be the same for both a pc and npc, it allows you to test how the npc/monster may move and what advantages/disadvantages it may gain ie give a small enemy fast accel but not too fast a top speed.

Anyway all i can say is im making something here i always dreamed of when i first played mario64 and it's actually coming together piece by piece :)


update(Posted 2006-05-09)
I've fully intergrated the game engine into the editor which now allows you to run a level from within the editor.
You just select run level and all entities come to life, hopefully following scripts how you want. You can even attach control to any npc and give him a run around.

Im having second thoughts on how levels are done as i want to make it a simple as possible to create levels and am going to do a lot of research and coding trying to make a 3d tile editor(building on my old 3d tile engine) which i can stick into the editor but also still allow loading of created meshes.


progress(Posted 2006-05-07)
The editor is coming along great. I created the framework for it and adding stuff is now very simple, im onto the character part so far, loading, saving and creating actors and maps is in thus far.

Im not planning on allowing level/map creation, just loading of precreated ones made with your own apps.
You just need to stick to naming standards ie walkable surfaces as "TYPE_GROUND" etc

The reason for this is because i can't do anything better than what is already out and don't want to, although i did create a basic 3d tile engine with raising/lowering, painting of paths etc. The problem is it all looked to square/generic and adding tiles was tedious.

More soon...


busy busy(Posted 2006-04-28)
Had a free day today so i've been hard at work coding.

I've sorted many classes out for game objects, so far i have:

Characters - these can be pc, npc/monsters etc

Active placeables - these can be anything really like chests, trees, tables, chairs etc

Static placeables - these are exactly that, the same as active except they don't do anything, no animation, scripts etc. Can be used for trees etc and help performance.

Buildings - these have door elements where you can attach doors and a trigger returning when you enter/leave. I am still unsure how i'm gonna do these -
A) Went you enter the house you load the interior/map
B)The house has all interior elements loaded and obscuring walls/roofs just alpha out to allow you to see in.

Although i could just leave this open with both choices!

Doors - These are attached to buildings and can be opened/closed, locked, attacked, destroyed.
They can also be attached to other objects which possess a door element ie part of a cage or fence

Item - Basically an item, which has a name, world mesh and a icon. The rest is upto the scripter e.g

used in OnUsed scripts of items:

If GetItemUsed$() = "HealthPotion"
SetStatistic(user,"health",GetStatistic(user,"health")+10)
sprite = Copy_3DSprite(Sprite_HealthUp);a preloaded sprite
Set_Velocity_3DSprite sprite,0,.1,0;set its movement rate
Set_AlphaMod_3DSprite sprite,-.01;set how fast it fadesout
Set_Mode_3DSprite sprite,MODE_FADEOUT
position_3DSprite,x#,y#,z#;position of user
endif

You can also add statistics to the item such as "Health" and a value and it will automatically increase any stats which match on the user instead of having to script it eg

First you would give actors a new stat eg

AddStat_Character(ThisActor.TActor,"HP",desc$="",value_Int%=0,value_float#=0.0,value_string$="")

Then add the same stat to an item eg

AddStat_Item(ThisItem.TItem,"HP",desc$="",10,value_float#=0.0,value_string$="")

now when ever the item is used it will look for the stat on the user and increase/decrease the values . Will also add divide/multiply/percent.

Actors, items, equipment, well anything not static can have unlimited user created stats!!


progress(Posted 2006-04-28)
I've been playing around alot with scripting lately and games that implement scripting ie nwn, morrowind.
Having it simple and fun to use was important and having just one main script or includes for scripts for each entity seemed painful(u still can of course)

I've decided to run individual scripts based on events/actions in game for each entity, meaning? Each entity has its own set of scripts for each event:-

OnHeartBeat; This script will run continously(unless it bogs performance) for all loaded and active entities ie npcs, placeables, maps.

OnConversation: Whenever this npc is put into conversation, wether they initiated it or not, the script will run

OnActivate: This can be used when the activate key is selected near the entity, uses could be to open a chest, check an npc characters stats, attempt a pickpocket etc

OnPerception: This script is run for the npc when the npc sees you. May add if they hear you to :)
You can have an enemy run at you and attack you.

OnDamaged: Runs when the entity takes damage

OnDeath: is run when the entity is killeddestroyed. Allows you to leave an item behind or a corpse etc

OnExitMap: This script will run whenever the npc leaves a map.

In the script you would do:

select MapExited(self)

case "home village"

dostuff()

case "city"

dostuff2()

end select

OnEnterMap: see OnExitMap

Their will be more scripts for lots of other events.
Some are still attached on entities and others global such as camera control.

I still have alot of planning to do and decide what is hardcoded and what isn't.
Their are many different versions on my comp with different approaches which i keep going back to and improving and seeing if they are better or worse. Hopefully i will come to a definite list which i can then start working on 100%

p.s. I'm not trying to make a gamemaker with total freedom but a 3d platformer gamemaker with rpg elements.


info(Posted 2006-04-07)
Im a big fan of nintendo games ie zelda, mario and rpg games and always wished someone would mix the 2 ie a deep rpg with the controls of a 3d platformer.
Games like morrowind left me feeling dissappointed cos the character control sucked and stuff like nwn was really point and click.

I've been working on many demos over the years to get my skills up to create my vision and things are finally falling into place thanks to blitz.

The engine will allow me to make a game similar to mario64/zelda64(i class this as a action-adventure) ie the controls and worlds but within a rpg style game ie towns and interactive npcs, stats, a deep story where you do quests, collect items and powerup.
The whole system ie controls, camera, ai, etc is all run through scripts and can easily be modified.

All entities in the engine are actors which have their own class ie pc,npc, container/chest, door, house, startpoint, checkpoint, leveljump so can almost have the same functions applied to them ie like blitz entities.

The pc and npc class both can be given the same instructions ie walk, run, jump, climb, attack, open a door/chest, initiate dialogue which makes them feel real instead of their for show and can have inventories, use items and interact with the world.

The engine has shadows from sswift, uses nuclear glory collisions with many a hack to allow some cools features in my engine, my own single surface system, bvm for scripting, my own pathfinding system based of djekstra, plus some other stuff i forget.

Im hoping to get something made with it as it's taken along time to get it to where it is now.

My rig, athlon 1600+, gf4200ti and 512mb ram, allows me to have 25 npcs with ai and collisions, run around at 60fps in a basic level all boned and highish poly 700-3000.
Obviously it will be a lot less within a fully running level.