-
Posts
938 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by tjheldna
-
Hi Pixel, I have recently done saving and loading. I didn't need to save object states in the level, more the players things like health inventory etc. The solution I came up with works very well using ostream and istream which is just in the std library so I believe it will be compatible. Here is basicly what I did First Created a template to overload the extraction operators template<class derivedTp> class Packable { public: void Write(std::ostream& os) const { static_cast<const derivedTp *>(this)->Write(os); } void Read(std::istream& os) { static_cast<derivedTp *>(this)->Read(os); } }; template<class derivedTp> std::ostream& operator<< (std::ostream& os, const Packable<derivedTp>& s) { s.Write(os); return os; } template<class derivedTp> std::istream& operator>> (std::istream& is, Packable<derivedTp>& s) { s.Read(is); return is; } If you want the object to save load just add the <Packable> template to the class in the .h and override the read/write classes class Player : public Packable<Player> The way I cope with changes are as follows each written object has a header and a terminator line at the end then breaks. If it finds the value good, if not it just goes onto the next header void GamePlayer::Write(std::ostream& os) const { short i = (short)(index); os << 'play' << std::endl << 'plid' << std::endl << i << std::endl << 'pcht' << std::endl << playerCharacterType << std::endl << 'term' << std::endl; } So I just loop through the lines and search for the header if the header matches any one of the cases it assignes the value else it just keeps on looping until terminated. void GamePlayer::Read(std::istream& is) { std::string line; long type = 0; while(type != 'term') { is >> type; switch(type) { case 'plid': { is >> index; break; } case 'pcht': { is >> playerState.playerCharacterType; break; } } } } Does this help?
-
Thanks for the help guys, with that I have come up with a solution. I just don't know if its any good or not? If anyone can review it; possibly point out any optimisations; or let me know I'm way off the mark, that would be awesome! This buffer thing and how it works is very new to me. I'm surprised I got this far. This is a copy from my code however I have removed my game stuff so may not compile straight off the bat. Anyone is free to use it if they feel it worthy. Testing images are attached. I and O keys raise/lower the level // ==================================================================== // This file was generated by LEBuilder // http://leadwerks.com/werkspace // ==================================================================== #include "engine.h" #include <iostream> #include <string> const char* MediaDir = ""; const char* AppTitle = "Test"; bool paused = false; void ErrOut( const std::string& message ) { std::cerr << message << std::endl; } // ------------------------------- int main( int argn, char* argv[] ) { if( !Initialize() ) return 1; SetAppTitle(AppTitle); int screenWidth = 1024; int screenHeight= 768; if(!Graphics(screenWidth, screenHeight)) return false; RegisterAbstractPath( MediaDir ); // Create framework object and set it to a global object so other scripts can access it TFramework fw = CreateFramework(); if( fw == NULL ) { ErrOut( "Failed to initialize engine." ); return 1; } // Set Lua framework object SetGlobalObject( "fw", fw ); // Set Lua framework variable BP lua = GetLuaState(); lua_pushobject( lua, fw ); lua_setglobal( lua, "fw" ); lua_pop( lua, 1 ); TTexture bottle = LoadTexture("abstract::manaBottle.dds"); TTexture bottleLiquid = LoadTexture("abstract::manaLiquid.dds"); // Get framework main camera TCamera camera = GetLayerCamera(GetFrameworkLayer(0)); int initY = 200; int Y = initY; //Declare Buffer and textures TBuffer buf = CreateBuffer(128, 128, BUFFER_COLOR); TTexture tex = CreateTexture(128, 128, TEXTURE_RGBA); SetColorBuffer(buf, tex, 0, 0); while( !TheGame->exitApp ) { UpdateFramework(); RenderFramework(); //Set the background SetColor(Vec4(0.5F, 0.5F, 0.5F)); DrawRect(0, 0, GraphicsWidth(), GraphicsHeight()); SetColor(Vec4(1.0F, 1.0F, 1.0F)); //move the level if one of these keys are hit if(KeyHit(KEY_I)) if(Y <= (initY + 128))Y += 10; if(KeyHit(KEY_O)) if(Y >= (initY))Y -= 10; //Set the buffer thing SetBuffer(buf); DrawImage(bottleLiquid, 0, Y - 64, 128, -128); SetBuffer(BackBuffer()); //Draw the buffer and the glass image SetBlend(BLEND_ALPHA); DrawImage(tex, 128, Y, 128, 128); DrawImage(bottle, 128, 190, 128, 128); Flip(0); } //Free buffer goes here right? FreeBuffer(buf); return Terminate(); } Thanks!!
-
Yay got a custom buffer working!! Thanks Daimour! The info from that video should go into the documentation for buffers.
-
That's exactly the effect I'm after... that looks cool! So your saying I need to use a custom buffer? I have tried to set up a custom buffer a while back, but there is practically no documentation that I can find on that. As far as I got with that is declaring the buffer with the calls to getsize and makecurrent. I have no idea how to render anything to it or what to do with the buffer after declaration . Any more info that info would be really appreciated!
-
Just wondering if anyone managed to get this technique to work? I'm trying to do something similar.
-
hmm really hard to say as I can't do it all in one hit due to work etc. I'm guessing about 20-30 hours on the sculpt + poly painting (no weapons). 90% of the work is in zbrush as I just bake the normals + diffuse + ambient occlusion to the low poly. Base mesh + UVW mapping 6 hours approx. Animations is too hard to say as it depends what is needed a guess. Initial rigging doesn't take too long, maybe an hour or so, however I always need to revisit this when I start animating. I do the two in parallel with each other. Hope that helps, I could be a bit off with the numbers. There are a number of factors that would influence the time to do create it i.e. how much zbrush detail, animation count, errors exporting and how many energy drinks I've had =). I have to do a female character for my game which I'll start soon which is of a similar nature. I'll make an effort to time myself.
-
Hi Josh, I can see the image now. I can create something like that no probs. Do you still need me to send you some images of previous work?
-
Yeah I've recently stopped my web hosting as I'm going to change host as I realised I was getting ripped blind. I'm also doing a redesign of my site in the process and hasn't been my priority. I can send you some screens when I get home from work. I did the LECP zombie/animations and pretty much all of the art/animations for the FPS arms side of things too (not the baseball bat). My recent blog has some images of some of the artwork I have created for my project (down below). http://www.leadwerks...-mages-alchemy/ I'll get back to you later tonight with some more.
-
I can't see the image it appears broken, however I may be able to create something for you. I'd need to see what you are after before I can say I can do it though. That's of course if you don't need it right away and you are interested. I'd estimate a 3 - 4 week time maybe a little more depending on the detail/animations you need. If not though that's cool!
-
The C4 engine uses Voxel terrain and I have used it quite a bit. Its very nice to be able to tunnel into the terrain etc.
-
For me personally its a massive success. Experience working as a team and having an end product to show has been awesome. Yeah the demo isn't perfect, but I'm really proud of what we have done. Correct me if I'm wrong...... I'm just wondering out of the approx 5 people left working on the project, did they vote to make a zombie shooter in the first place? I have a feeling that the people who voted zombie shooter all left within the early stages of the project leaving the 5 left people to make a style of game they didn't really sign up for? am I wrong? I'm curious to know the answer to that (I for one didn't vote zombie). That factor came into my decision to vote no to continuing with this project. If Aggror says lets do it again with a different style of game and I had the interest in that style. I'd be in.
-
Thanks Aggror, I will use your services if there on offer. I'm taking some leave from work around the 24th. So after I've had a full working week on it, which will be awesome (around the 29th Sep), some external testing would be very welcome indeed. I forgot to mention If you create the user Aggror your difficulty level automatically goes through the roof =).
-
They look amazing. If you had an fps gun with scope you would definitely want the first one as its shader! I have no idea when it comes to shaders and I'm going to need to learn. Where does one start?
-
Thanks Clackdor. I thought I had my hands full with one baby boy! My hat goes off to ya! I work in primary schools in IT field and the schools I'm at have iPads from rec-yr2 and macbooks from yr3- 7 and growing. I haven't been very impressed with the level of educational software thats available. It's surprising how many pieces of software still need the disk in the drive to run; never have proxy options or run properly in a network environment. Makes me sad. Anyway I've learned heaps of what not to do for this project. I have had some input from teachers during this process too. It's needless to say LE3 is looking very attractive to me. There wasn't any thing like aiming/firing planned. I hope to do a video soon which will clarify what you have to do more. The way I plan to initialise a maths game goes... - Say you encounter a lowered iron gate. (There will be a GUI element to let you know that magic can be used on an object). -You have a spell inventory so select your raise spell and cast it (within radius of the object) - The maths game is triggered. I'm trying to think of other things to add in like figuring out which spell to use on an object so some simple problem solving is involved. I don't plan to add anything much more than that. Cheers
-
Thanks for the feedback and kind words people, I'm really happy. Apart from one other project this is the first project that has ever seen the light outside of my study (the other is in a graveyard of unfinished games). It has been a pleasant surprise that making a game that doesn't revolve around violence and has more fun to make. I have never had one of my game projects so complete and all the while working on LECP too! I do feel like a bit of a unit, I need a sleep catch up week. There still is a way to go, but I really am hammering my way through it. @gamecreator More than likely this will be a free download. My whole goal as far as game dev goes is to make a game that people take the time to play. I just accomplish that and see if anything comes from it (or not) later I guess. @Red Oktober I think you are right. I came up with the title quite some time back and I do remember googling it so I believed that was the spelling and never checked it since. You really can miss obvious mistakes when you have been looking at it for so long. Lucky this isn't a spelling game lol. To be honest maths and English have never been my strong points (That's right bring out the violins) and I struggle with some of the equations that my own program throws at me! (especially multiplication). Anyway that was a nice pick-up and I'll correct it tonight. I'm still not sure if I'm going to keep the name, but I haven't thought of a better one. Thanks Again!
-
Hi all, I'd like to introduce the game I've been working on since I purchased Leadwerks and am very happy with the results in the short time span. I have been working on games for as long as I can remember, however this is the title that I'm actually going to finish. This has turned out to be quite a long blog entry. I hope you enjoy.... The Title The title of the game was always going to be a stand in name, however over time I have grown accustomed to it and it may stay. The Concept The concept of this game is primarily a learning game in particular addition subtraction and multiplication. I'm sure games like this have been done before, so I am taking what I hope to be a different approach. I want the user to feel like they are playing more of a normal game by creating an immersive and magical world. With that fact I hope to make the user feel like they are not learning when in fact they are and are anticipating the next challenge. The initial design incorporated a vast world with quite a detailed storyline to match. This being an overwhelming task for 1 developer forced me to trim back features and then trim back some more until I was left with more or less a skeleton of what I originally planned. In doing this it has made the learning side of things much more visible. The End User I am a little worried about my target audience for this game. The target audience is for students (not limited to) around the middle primary years. I am hoping that parents like me who see games as a great way to learn and would use this game to supplement the students learning in a fun way. The biggest risk is that the users will not have the required hardware to run this game. Are there may parents out there with gaming machines for there kids to use??? On a personal note I recently had my son (12 months) in front of the game as I was just running the character around, testing some elements and he was glued to the screen and laughing with excitement. This has given me hope that I am on to something here!!! Wow that really made my day. I intend to expand on the features once the initial game is done and add more game play elements that I really and create the game this intended to be. This will hopefully make the follow up game more manageable and help sow a seed for it. The Engine I have tested and tried many different game engines and this seems to be the best combination of ease and features that I can find. I have tested Shiva, Unity, Gamestart, and C4. Releasing I am setting a tentative release time frame for around late Jan/Feb 2013 but hopefully sooner. I do not plan to charge any $ for the game however this may change. Regardless if I do, the amount will very minimal. A possibility is to maybe limited to the first limited number registers are free or something like that. Due to restrictions with the Leadwerks engine I can only release this on the Windows platform, but will port as soon as LE3D becomes available. The no terrain thing will impact heavily on this project as it relies heavily on it, but I'll have to wait and see. I would love to see this on a mobile device it would be perfect for it. The Game Camera The game is like a 2D side scroller that can turn corners and is not just limited to just left right. I think its called a rail camera, well I'm going to call it that anyway. The camera follows the player and transitions between camera nodes in the world and is always facing the direction of the player. The tricky part was how the player controls work in relation to this as if you walk to the opposite direction of the camera you can find your inputs reversed (with fixed up/down/left/right). The way I solved this is that the up movement is always the direction of the camera, it really makes for an easily controlled character however you do need to course correct as the camera moves which is hardly noticeable, but feels natural. Tasks Throughout the game you encounter obstacles which block your path. These can be in the form of drawbridges, gates etc. These obstacles can be removed but only by using the magic of math! A successful round will see the obstacle removed and you can proceed to the task and eventually complete the level. The Math The game focuses on add, subtract and multiply at this point in time. The math has different levels of difficulty to suit a more larger audience. Initially the game was designed for grade 3-7, however this is not 100% decided as game content and difficulty may not suit years that low. I plan to add divide and number sequences at a later date. Levels The levels will range from forests, castle's and dungeons. I am hoping to produce around 10 levels for the initial release. A forrest level and a castle level are in the works, most of the other levels will be variations. Once a level has been completed there is no stopping you from re-playing the level. You may need to as you need to collect enough coins or an item to continue. GUI I created my own GUI interface code, purely from using LE functions. The interface includes windows, buttons, image buttons, checkbox, radio buttons, borders, images, listbox, label and text boxes. These are used extensively in the game however, the entire GUI appearance need a lot of work and I am forever optimising this GUI system. I'm currently experimenting with colours. Reporting As the player completes math tasks in the game your stats will be saved to your profile for later reporting. The stats are saved to a sqlite database due to it's ease of installation. I don't want the users having difficulty installing something like mysql and then just giving up. MySQL functionality will be added later so that can be installed on a server and the game connects to the database to accommodate many users and to keep data safe . Connecting to a database hosted by me is also an option I'm considering, but it really depends on how big or not this project gets. Website Currently I have abandoned my website and am looking at starting from scratch. New company name new website and new host. I am in the process of creating an entire world (on paper) and publishing it on-line so you can go into the website and read up on the game world's lore. Functionality Done Complete GUI system using only Leadwerks functions. Complete Inventory system (Pick ups, mounting weapons etc). Near complete Game Interface system. Character controller and animations. Camera movement system. Complete serialization system (serialization of the whole world was not needed for this project however. I will implement this at a later date). Math games. Complete User login system. Database saving. Combat system - melee, projectile shooting weapons (not sure if will be used for this game however). TODO Magic system (it has been worked out on paper though) Testing I will require some testers when the game is in its Beta stage and will post on the forums when ready. Here are some preview images some things aren't textured and some are WIP. I'll create a video soon when levels are more complete!
-
Thats awesome guys Thanks!!
-
Hi All, I'm looking at serializing the current game state for saving and loading. My first question is... Do entity's that are added/removed from the world editor have some sort of unique id assigned to them that I can access? I noticed that the entity "name" field is unique and increments as you drag them in the world, however this could easily be trouble with duplicate names due to copy/paste and user error. That dosen't seem like a robust solution to use the name for its unique identifier. So what I plan to do is loop through all objects in the world match the id's; if its of a certain type then call its load/save function as required. Maybe is there a better way of doing this task? Cheers!
-
Thanks Metatron, Thanks Josh, I'll do a little more testing on my end before I do that. I'll let you know what I come up with! Cheers
-
Hi All, I have a problem that I think its time to fix but I'm not sure how. Id like to be able to change graphics settings while in game. I am having difficulty doing this. It seems while I have my level loaded and I do things like change the screen resolution, turn on off HDR etc the terrain disappears and the models appear super bright. When no level loaded the settings apply fine. So my questions are........ Is doing this not possible (should I just disable changing settings while in game)? If it is possible, which I'm guessing it is as it works in the world editor, what am I doing wrong? Thanks in advance!
-
Wow it really has taken off in the last week, great work guys!
-
Thanks for that. I'll try it out
-
I can't seem to access the SetViewport funciton in C++, is it available? It looks quite useful just looking at the Lua GUI code.
-
Thanks Josh I'll give this a go. Thanks!!
-
[Solved kind of :)] My feet's does not touch the ground sometimes
tjheldna replied to Roland's topic in Programming
I know the C4 Engine solves this a bit better by using a capsule instead of a cylinder. I doubt that would help anyone here though =).