The Pirate Engine

Blitz3D Forums/Blitz3D Programming/The Pirate Engine

Oiduts Studios(Posted 2009) [#1]
I am working on my first game engine and so far it looks good, I have a working gui and you are able to customize almost anything with out altering code. One of the key features i am working on is to be able to customize game content. I can already add object to the game and texture and adjust them, but later i want to be able to turn these objects or multiple objects at once into a car, weapon, enemy, or anything else in the game. What is the best way to do this?


jfk EO-11110(Posted 2009) [#2]
You want to turn these objects into a car? Do I get this right, you want some kind of transformer thing, eg. a number of trashcans build a group and assemble themselfes together to a huge car?

If that is what you want then you maybe best load the objects as the finshed car, with all parts as child meshes. You may then position etc. the children. To reassemble the car you would then only have to position them at 0,0,0, or at their initial position (and rotation) that you may have to store in some variables before.

If you want the whole thing to be more flexible, eg. to build that car, with all available trashcans etc. then you might think about some sort of LEGO(tm) approach instead. You could make a LEGO sim and then simply replace the LEGO Bricks by Trashcans, or whatever. Then simply throw some kind of Plan at the engine and it will assemble the Car, using the Pseudo-Bricks.

Well, probably I completely misunderstood your question.


Oiduts Studios(Posted 2009) [#3]
Yes and no, i would like to make the player to be able to select which object he wants to combine to make a full entity, I am either thinking of AddMesh or using a pivot.Which do you think would work best? Also i have already made it where every object is scalable.


Matty(Posted 2009) [#4]
Don't use addmesh as you won't be able to access the individual entities within the mesh then as they will all form one mesh.
Simply parent them.


Oiduts Studios(Posted 2009) [#5]
ok i will see to it, thank you


_PJ_(Posted 2009) [#6]

Don't use addmesh as you won't be able to access the individual entities within the mesh then as they will all form one mesh.


http://www.blitzbasic.com/Community/posts.php?topic=85564#968350
Are you sure?

(note - this isnt a sarcastic retort - AddMesh seems a litle confusing regarding this point.)


Warner(Posted 2009) [#7]
Hopefully this demo can shed a bit light on it:



Oiduts Studios(Posted 2009) [#8]
Wow, thank you all, i guess i am going to use addmesh


jfk EO-11110(Posted 2009) [#9]
"Don't use addmesh as you won't be able to access the individual entities within the mesh then as they will all form one mesh.
"

"Are you sure? (note - this isnt a sarcastic retort - AddMesh seems a litle confusing regarding this point.) "

As far as I see the Demo by Warner shows that Matty was right. When Adding the Mesh to fullmesh, using AddMesh, then it will become a part of one big single mesh. If the added Mesh was painted with a brush that is new in fullmesh, then the brush will be added. If an identic brush is already existing then it will me merged with the surfaces of the brush, in order to optimize the surface count.

You will however not be able to turn, scale, remove etc. the added Mesh as an individual Unit anymore, if it is once AddMesh-ed.

For your project you maybe better use a simple Parent-Child hierarchy instead. First create a Pivot, then parent all Parts to that pivot. Now you can move the pivot to move all parts. Or you can move,turn, scale, remove etc. individual parts directly.

When using the online command reference you may use the searchstrings "parent" and "child" to list all relevant commands for parenting entities.


Oiduts Studios(Posted 2009) [#10]
awesome, thanks i will start on that