-
Posts
136 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by smashthewindow
-
-
Does anyone know how the demo recording system in Source engine is done?
I would like to implement something similar in my game, but I am absolutely clueless on how to do this.
My initial thought is to save the absolute positions of every entity per frame into an XML file and then move every entity accordingly during demo replay.
But my current solution would probably end up with giant XML files and game crashing when trying to load the XML file. (I currently use TinyXML as my XML library.).
Thanks.
-
Start with a root widget, then draw its children recursively.
I found a bomberjack example at the demos section, good for anyone looking into the topic.
-
So I'm almost finished coding for my game, the only problem is that I need to create a in-game gui and a loading system.
However, I just can't think of the appropriate way to do this.
Can anyone tell me how my main loop should look like?
I don't need specific code, just the concepts, but sourcecode example would be good.
-
Thank you, now I can see this while I'm on the move!
-
Please post your files so we can try ourselves.
Here they are. Thanks for replying.
EDIT: Nevermind, stupid mistake in texturing...
-
It shows up find on 3DS World Studio, but like that in Leadwerks Editor and the game. (The black lines...)
Does anyone know why?
-
in 3dws using the default scale conversion that is used with the inherent exporter, a 128x128x128 box in 3dws is equal to exactly 1x1x1 meter box in LE.
use the '[' & ']' to change grid size in 3dws of the active orthogonal window - suggest you look at the Key Shortcuts listed in the Help file - granted all of these are shown as well from the pulldown menus...
oh ****
lol
Could you elaborate more on 128x128x128 box size? how do I see the size of a box?
EDIT:
HAPPY
-
I've been messing around with blender and 3DS World Studio.
How do I set the grid size in the 3DS World Studio so that one grid would match the size of 1 unit in Leadwerks Engine?
Also how do I use the ConvertModel tool? What type of models does it convert? I selected the folder that has a .obj and .gmf it still doesn't work...
-
SetBodyElasticity(ball,5);
I thought max value was 1?
P.S: it still goes through walls when it gets fast enough.
-
Hi, I'm trying to code something like the Bouncy Ball in GMod. (Here's a video:
)Basically, I'm trying to create a mesh that bounces without losing any velocity at collisions.
I've tried this by setting the velocity constantly at update callback functions(the one that gets called every frame, UpdateEntityCallback), but I've realized that sometimes the ball goes through the walls.
Any suggestions for a better implementation?
-
Thanks for all your help, Mumble and Rick.
I still havent figured out my problem, but I've tested the following code on a sample project, Get/SetUserData seems to be working fine.
Maybe it's just time for me to rewrite some stuff.
Fixed the problem:
This is my class layout:
Object->Ball->Controller
I have a virtual function in Ball & Controller (its called GetBallType(), returns int )
I removed the virtual function, everything's working perfect and all. (I were thinking somethinking like pointer alignment because the address I got from GetUserData was always 4 bits off from the original place - maybe the vtable pointers got messed up.)
Can I ask why it maybe causing problems like that?
-
void Scene::LoadMap( string mapname ) { _mapname = mapname; _scene = LoadScene(mapname.c_str()); _camera = GetLayerCamera( GetFrameworkLayer(0) ); PositionEntity( _camera, Vec3(0,0,-2) ); ProcessMapInfo(); ProcessMap(); } void Scene::ProcessMapInfo() { } void Scene::ProcessMap() { if(!_scene)return; TEntity e=NULL; int i=0; int done=0; int childs=0; string tp=""; string en=""; string em=""; string ct=""; // collision type, used for collision with static objects while(!done) { done=1; childs = CountChildren(_scene); for(i=1;i<=childs;i++) { e=GetChild(_scene,i); tp=GetEntityKey(e,"Type"); en=GetEntityKey(e,"Name"); em=GetEntityKey(e,"Mass",""); ct=GetEntityKey(e,"CollisionType",""); if( tp == "info_ball_node" ) { Controller newcont(e); //newcont.SetCamera(_camera); done=0; break; } } } }
shouldn't be a problem as there is break; before the closing braket of if (this is how gamelib does it.)
gives the same results even if I use the global instances.
-
So you are stepping through this and e->UpdateBall() makes it into your Controller::UpdateBall() and you are seeing _campivot as a bad pointer is that right?
I don't see where _campivot is being created in your code above. Also not seeing where the callback is setup above. Can you show that. Also I assume you are creating a pointer to Controller like:
Object* obj1 = new Controller(); ??
Controller( TEntity entity_ = NULL ) { Ball::Ball(entity_); //set mesh of the ball SetMesh("abstract::ball_ball1.gmf"); _campivot = CreatePivot(); _camposition = CreatePivot(_campivot); PositionEntity( _camposition, Vec3(0,0,-5) ); //control variables camrotation=Vec3(0); cam2rotation=Vec3(0); mx=0; my=0; move=0; strafe=0; jump=20; SetEntityCallback( _entity, (byte*)UpdateControllerCallback, ENTITYCALLBACK_UPDATE ); }
That's my constructor.
Object->Ball->Controller, this is the class inheritance structure.
Everything else I've implemented is working except for the accessing userdata part.
Object* obj1 = new Controller(); ??
and no. I loop through entities in a map and search for the entity with key "ball_controller". From there I call
Controller my_awesome_controller_instance(found_map_entity);
basically a while() & for() loop like they do it in GameLib.
Thank you for replying anyways.
-
Okay, I need some help in C++...
I'm just a hobby programmer so I'm not that good.
I've a basic class called "Object", and every class I made inherits from that object:
class Object { public: TEntity _entity; TVec3 _abspos; Object( TEntity entity_ = NULL ) { if( entity_ != NULL ) { _abspos = EntityPosition( entity_, 1 ); FreeEntity(entity_); } _entity = CreatePivot(); SetEntityUserData( _entity, (byte*)this ); //take notice in this part... HideEntity(_entity); } };
and of the callback function:
void _stdcall UpdateControllerCallback( TEntity entity ) { Controller* e = (Controller*)GetEntityUserData(entity); e->UpdateBall(); } void Controller::UpdateBall() { PositionEntity( _campivot, EntityPosition(_ballmesh,1) ); }
Of course, controller inherits from Object class and yes, Object's constructor is called.
But that PositionEntity() throws an exception if I run it at VS2010 (_campivot is a bad pointer...)
I know this is noob question, but I can't figure it out after hours of searching.
Can anyone help me?
EDIT: Basically, I'm asking if anyone knows what the hell is wrong with UserData setting/retrieving...
The pointer I get from GetUserData() func seems to be +4 bits from the original location.
I'm using Leadwerks 2.5 by the way, straight from the Updator.
-
moved to beginner section.
-
All of your answers have been a big help. Thanks a lot guys, got exactly what I wanted to work.
-
in the editor's asset list on the right, you have the models available to drag into a scene... if you double click on the model icon in the list it will open the script editor and the model's lua script... this is where you can add properties... look at the standard models that come with the SDK to see what is in their object scripts to see how this is accomplished...
thanks for the reply
I've been looking at the point light's LUA example and trying to find "light_point" string(which is it's class name). But there isn't on the LUA file.
Help?
-
As the title, how would I be able to add new entities?
I've seen into gamelib example of scene loading and it loads some keys from entities such as class name and so, where would I set this?
-
Actually this is one of the things that I had a really hard time with too.
What you could do is look at how GameLib initializes it's things, the Source SDK (Source Engine's Development Kit) for some reference source code on structuring you're custom entity system,
some Leadwerks forums for more tips.
Of course if you're doing this in LUA you would have to find the engine function equivalents through the Wiki. (Which is farelly well documented.)
-
Thanks all for the reply.
-
Is there some engine function to get the slope of the current environment that a controller in on?
I'm guessing that this is possible due to the fact that the controller take's a parameter that set's maximun climb angle of the controller at it's constructor.
If not, I'm thinking raycasting to solve my problem, but I'm just making sure before I go do something stupid.
-
it would have been nice if the wiki showed some theories or concepts of how people set up/integrate their entity structures though.
Actually nevermind. I found this amazing library called GameLib that kinds of shows you how to do all the basic stuff.
I should probably be looking into that closer now.
-
Yes. Leo is finnished since long time ago. The goal with LEO is to be a thin class wrapper around the C-api. No more and no less. Same thing goes for LE.Net
Ah, I see. I came from a Source engine modding background, and was quite surprised when I saw that the structures was a lot different.
I'm a nearly noobie in game programming, so it would have been nice if the wiki showed some theories or concepts of how people set up/integrate their entity structures though.
-
While I am not familiar with LEO, keep in mind that when you're doing IsVisible between two meshes, you need to hide both meshes prior to testing or the result will always evaluate to false.
I run a filter function to filter out some of the things it should ignore But thanks for the input.
What template do you use? I get a feeling that the LEO template isn't quite finished, and I'm pretty fluent in other language other than BlitzMax, so I might as well change.
Source Engine demo recording system
in Programming
Posted
https://developer.valvesoftware.com/wiki/Demo_file
https://developer.valvesoftware.com/wiki/Demo_Recording_Tools
It's mainly used to create high-quality game recordings (export to picture frame by frame, edit by something like virtualdub).
I need something like this.