Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

182 Neutral

About mattdev

  • Rank
  1. You want int xDiff = myx-x; int yDiff = myy-y; int distance = sqrt( (float) (xDiff*xDiff+yDiff*yDiff) ); instead of int distance = sqrt( (float) ((myx-x)^2+(myy-y)^2) ); "^2" doesn't square things, in C++.
  2. mattdev

    RTS saved map format?

    You'll probably want to be serializing the appropriate objects (assuming you're programming this in an OO language), and it'll make your life much easier if you're using a decent serialization system - one which keeps track of which objects have been serialized, and redirects pointers to those objects when they occur in other objects. Ideally your base entity class will declare a virtual function called something like: virtual void Serialize(ArchiveData &data, bool loading); Then each of your derived classes will implement this appropriately, for example: void Unit::Serialize(ArchiveData &data, bool loading) { BaseEntity::Serialize(data); int version = 1; if (loading) { data >> iVersion; if (version == 1) { data >> m_health; } } else { // Saving data << version; // Write out the version number for this object data << m_health; } } ArchiveData should be some kind of stream object, whose << and >> operators are overloaded to read/write data to the stream. Whenever your serialization format changes for that object, you increment version, and change the loading code to match the new structure. When saving (or loading), you can simply call Serialize on whichever root object contains your game data, and any objects it points to will hierarchically get serialized out/in, too. Note that this is just one way of doing it - the one that I'm familiar with. There might be other (better) ways of approaching the problem. Hope that helps! :)
  3. mattdev

    i really dont get headers

    Quote:Original post by ChrisPepper1989 but now i get these linker errors: 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __stricmp already defined in LIBCMTD.lib(stricmp.obj) 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library You're using the wrong version of the runtime library. You need to be consistent about which version you use; all linked libraries (and your executable project) must use the same version. It can be multi-threaded, multi-threaded DLL, or the debug versions of those. There were also single-threaded options before MSVC 2005, afaik. This setting can be accessed through Project Properties -> C/C++ -> Code Generation -> Runtime Library. Hope that helps!
  4. mattdev


    Very cool fish :) I imagine he's just using the vertex coordinates (scaled) for UV's.
  5. mattdev

    Udo progress

    Very cool, I too am glad you're carrying on with Udo :)
  6. mattdev

    Let the carnage begin...

    I don't know how you have enough hours in a day to get all this work done. One minor thing: maybe you should use a variety of explosion textures (or just modulate each particle with a slightly different colour), they all look quite similar at the moment. Otherwise, brilliant :)
  7. mattdev


    Lightmaps are working :). Currently I'm just using N.L as the lighting calculation, radiosity is next on my list... and I'm assuming that'll be the harder part. Screenshot (the stuff in the background is from not clearing the target each frame):
  8. mattdev


    It's been a while since I last updated... since then, I got the game to a state where it was playable and fun for a few minutes. I would need to add some more enemies/spells and spend an age balancing everything if I wanted to release it like that (and I'm guessing I can't just use all those MD3s without permission...). I can't really bring myself to spend time doing that. So I decided to just press on in a different direction. I changed the camera angle to behind the player, and slightly to the right of him (trying to emulate what I've seen of Gears of War ;)). I also brought out an old 3DS Max exporter that I wrote, exported some geometry, and wrote some code to read that into the engine. Finally, I read through this excellent article and managed to implement collision detection for the character (which seems to work 99% of the time...). So you can now run around in a little (un-lit) level, without going through walls. The rest of the game is still in there at the moment (although everything that was meant to be viewed top-down looks totally wrong when viewed from this angle, like the blood effects etc.). I'm not really sure what I want to do with what I've got now; I'm pretty confident that I don't want to finish the game as it was (a clone of Crimsonland), but I'm still quite keen on having ultra-simple gameplay. My current thoughts: keep it outdoors-based, where the player shoots oncoming hordes of enemies, but have little "towns" consisting of indoor areas, which the player can go back to occasionally. In the town(s) he can spend cash (buy items, etc.) that has been earned off killing monsters. So... very much like Diablo, except 3D, and without any of the dungeon/quest-type stuff. Anyway, all of this stuff I'm adding to the engine is relatively reusable, so even if I change my mind about the above paragraph within the next few days, I won't have been wasting my time ;P. Next step will be to generate some lightmaps for this geometry. Finally, a screenshot of some geometry with a single texture on it... the ground plane that I was using before is still sticking through there.
  9. mattdev

    Early Rain effect + Order icons

    The rainy atmosphere you've got there is really convincing. And congrats on 100k journal views!
  10. mattdev

    Best. Weekend. Ever.

    Nice work, it's looking great!
  11. mattdev

    HUD stuff

    Looking good, you're really getting through this stuff quickly.
  12. mattdev


    Heh, thanks :)
  13. mattdev


    Not much new to report for the game, just been cleaning up code & fixing bugs. I've also been playing around with C# recently... seems really cool. There was actually a point to posting this entry, however! I made two short videos of the game; they're ultra low-res; that's all Fraps can manage to output on my laptop, I'm afraid. Anyway, here they are: video 1, just showing me running around and killing some doods video 2, showing spell effect pixel shaders
  14. mattdev


    That video's really amazing. Keep it up!
  15. mattdev


    I spent the last day or so trying to work out why my game wouldn't run outside of Visual Studio. It ran fine in the IDE, no problems. Eventually I worked out that I could get it to run *sometimes*, if I linked with the multi-threaded CRT, as opposed to the multi-threaded DLL CRT. It's comprised of two parts, by the way... my engine, which is a DLL, and the game (which is an executable, obviously). Finally I ran into this article, which suggests that I need to do some fancy stuff with exporting STL objects if I'm using a DLL. I don't know if that article applies to VS2005, though.. it seems to be targeted at VS 6.0, and other URLs such as this seem to suggest that if I'm using one CRT consistently (which I was already doing) in a post-6.0 version of VS, I shouldn't need to do anything special... Anyway, I tried that for a while, without much luck. Eventually it dawned on me that I don't really need my engine to be a DLL, so I made it a static library and all seems (relatively) fine now. At some stage during all this, I took a break and tried my hand at modelling a head in 3DSMax. Considering I've got very little artistic talent, I was quite pleased with the result. The head is still a bit oddly shaped, though. I might try fix it up later today, and then attempt to make a body for it.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!