Jump to content

CartoonGuy - Heeee's Back !


Guest Red Ocktober
 Share

Recommended Posts

Guest Red Ocktober

yup... this go round, GameObjects has been (loosely) integrated into the Leadweerks 2.26 Sandbox Editor, so that now, any art centric type who gets a premade GameObject from a code centric type :) can easily drop this object into his/her Sandbox scene...

 

save the scene... open BlitzMax... add a line of BlitzMAX code... compile... and Dadaaaaa... their new object can be seen running around in their game...

 

 

no need for lua or scripting or anything else...

 

 

it can't get any simpler than this... :):D

 

 

 

ok... enough spin... lets get back down to earth...

 

first... this is still experimental... what i mean is, without a doubt it works... it's just that i've expanded the concept of GameObjects to include the Sandbox Editor... and the scene, complete with the new GameObject runs fine... i still have yet to make a fully independent autonomous object that requires no additional coding besides that which it comes with... but i think that'll also be possible...

 

anyways...

 

take a look below at the screenies of the CartoonGuy object in the editor... and below that, of the same scene running in BlitzMAX (the guy is animated)...

 

 

and here's the only 2 lines of code that you would need to add to my new ProcessScene() to enable a GameObject character or boat or plane or tank or horse (or anything you can imagine) to work in a BlitzMAX/Leadwerks GameObjects enabled app...

 

                 ElseIf Lower(className)="gameobject_animesh_guy"			
		  Include "AniMeshObjects.bmx" 

 

 

 

anyone can have a game up and running in seconds using this concept... without any coding...

 

 

ok... like i said... the spin is over... you will need to code something...

 

 

here' the code someone will have to write for the app...

Strict

Framework leadwerks.framewerk


Include "ProcessScene.bmx"


'				CHANGE TO ACCOMODATE YOUR SYSTEM
RegisterAbstractPath( "C:/Program Files/Leadwerks Engine SDK226" ) 
'RegisterAbstractPath(AppDir)


RegisterGame("Test1",1024,768)


Local scene:TEntity=LoadScene("abstract::islandlights2.sbx")
ProcessScene(scene)



runGame()

 

 

and...

 

 

you will need to either write a 'class' definition for the new object, or have a coder write it up for you... but that to is no different from what anyone even slightly familiar with BlitzMAX is used to...

 

most of the stuff is already set up... you, as the coder just have to deal with a single source file where you give functionality to your object...

 

your object will need to have a single update method... that's it... the game's mainloop is handled by GameObjects code... you never need to touch it...

 

here's the entire definition for CartoonGuy

 

'---------------------  the code header to be executed by ProcessScene 
'			 
Local		name:String = String(GetEntityKey(entity, "name"))    
Global  	CartoonGuy1:TAniMesh=New TAniMesh
	CartoonGuy1.Register(className, name, "Abstract::untitled.gmf")	
	SetEntityMatrix(CartoonGuy1.mesh,GetEntityMatrix(entity))
	CopyEntityKeys(entity,CartoonGuy1.mesh)
		           ' CartoonGuy1.SetLocation Vec3(15,22,155)
	SetEntityMatrix(fw.Main.camera,GetEntityMatrix(entity))	
	MoveEntity 	fw.Main.camera,Vec3(6,2,-6)
	rotateentity fw.Main.camera, Vec3(0,226,0)
	HideEntity(entity)
	entity=Null 



'--------------------  the class definition (so far)
'
Type TAniMesh Extends TGameObject  
 Method Update(context:Object)
   If(TAniMesh(context).mesh<>Null) Animate(TAniMesh(context).mesh, AppTime()/26.0)
 EndMethod

EndType

 

now so far this GameObject class can do nothing more than animate itself... but the concept should be apparent...

 

 

ok... more on this later as i actually get something significant working... but my whole idea behind this is to keep things simple... free the developer to make a game, and not to spend months on coding... i think GameObjects does just that... now it's even easier than it was before... now it leverages the Sandbox Editor...

 

 

thx for taking the time to read... questions and comments welcome...

 

 

--Mike

post-65-12769658787197_thumb.jpg

post-65-12769659615491_thumb.jpg

post-65-12769693142962_thumb.jpg

Link to comment
Share on other sites

Guest Red Ocktober

What's the idea with how game objects communicate with each other?

 

what sort of communications... seriously, what interobject communications are you talkin about...

 

 

--Mike

Link to comment
Share on other sites

Guest Red Ocktober

GameObjects 0.5 is up and working... it's now integrated with the Sandbox... and i have a single TAniMesh type of GameObject i can add to my game...

 

it doesn't do much more than animate when you click on him, but this was a significant lil step in that a single class of objects can be programmed to react as individual objects, reacting only if 'told' to do so by player action...

 

the next step is to allow em to interact with each other in a limited manner, beyond the basic collision response... most GameObjects will be human control things like valves, switches, doors, etc...

 

interaction with the environment and other object types giving them a fuller sense of individuality and rudimentary behaviors will be a lil farther down the line depending on what my games will require...

 

i'll also looking forward to NA's AI logic so i can try and integrate it to a GameObject classes to impart a bit of intelligent behaviors...

 

so far this is kinda cool... i'm surprised at how smoothly it came together... a few days cdoing and it's nearing proof of concept validation... just a lil more to do and it looks like by the end of the week it'll be finished (for single player game functionality)...

 

 

 

--Mike

Link to comment
Share on other sites

The more I look at your code above the more it looks like the Lua implementation that Josh did with the new LE version. You are using BMax instead of Lua though. Was that the idea behind what you were trying for or are you allowing multiple scripts per game object?

Link to comment
Share on other sites

Guest Red Ocktober

if i did this in c++ you could still say it looked a lil like Josh's lua implementation... the basic methodology is similar, so i guess that is inevitable...

 

there are differences though...

 

BMax and c++ are compiled... they have true inheritance... GameObjects class (type) is at the root of everything, and as the different classes of new objects inherit from TGameObject, so can descendant classes of these objects inherit from their ancestors...

 

there are no scripts... no need to code anything (except adding the include statement for the class)...

 

no multiple code for any gameobject class... you want a cat.. you code a cat animal... then you let it go and allow the artists to use whatever model they wish with the logic...

 

 

still and all... the goals were basically the same... ease of use for the coder as well as the non coder... i think this approach is cleaner, faster, and it took less time to implement than the time it took to integrate a scripting layer to the existing LW framework... (don't let Josh read this... he'll kill me :D )

 

anyways... since i'm proabably the laziest person out there, this was done primarily for me... so i can focus on one thing at a time... if i need a valve, i can focus on doing just that... and it should plug right in... write it once... use it over and over again...

 

should someone who is not a coder need a valve... they can model a really decent looking valve... drop it into the sandbox... and use the Valve GameObject class to make it come to life...

 

 

--Mike

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...