Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

160 Neutral

About Dae

  • Rank
  1. Dae

    limiting player speed

    How about going back to basics and only applying the velocity change ON KEY DOWN, which shouldn't be called again until ON KEY UP. Use key states, checking for change.
  2. Dae

    webcams in games

    I've seen this before. It was in some 2D Asian MMOG (or multi-server system). I didn't play it long, as I didn't like the controls/movement and boring RPG gameplay. Basically it had some sort of feature select a player and open a webcam window, and the small like 200x200px video would pop up. Comparative to voice chat that's wide spread in America MMOG's these days. I doubt there were moderators, at least not many. Standard game masters. MSN, lol, ya, but better are things like Stickam and those paid cam sites. Edit: I think this was it, here you go:
  3. Yeah, I ran into the same bug a few days ago. Argh.......... However, I dread every time I have to switch to Windows or load VM. Start a fresh project on a fresh distro and all I have to do is apt-get a few times and I'm up, running, and using Boost libs, MySQL lib, Z lib, cURL lib, libtorrent, git, and pretty much anything to start developing. Built-in multiple desktops, better window management, top > taskmgr, I can't imagine going back to Windows. Unfortunately, I'll be forced to back and forth throughout my life.
  4. Provide a "downloader" on the download page. Many online games these days use them, and the newest ones seem to be using libtorrent in the background (the smart ones). Basically it's just a small custom libtorrent GUI application that downloads your files and only your files. Then you can have a dedicated upstream of like 100kbps or whatever available. There might be an existing solution (I don't know).
  5. Thanks for the insight, Captain P. I think it's helpful kind of looking around the table, figuring out if you're on the same page. There's something to be said about consensus. Let's say I hit the Up arrow and my character moves forward. It moves the model up the y axis. Now what's the best course to get from there to telling the physics and network module about the change? (I call them services, some ppl call them devices, systems, managers, etc) As of now, I have it in the is_key_down scope, constructing a movement event (packet), and sending it to the modules. That's during the update phase. Then I figure what if I have the class that handles the network module register to an on_change event with the player, so all of that packet constructing stays in one place, and the rest of the code isn't aware of the network. Then I'd probably end up sending too many movement packets per frame, so just marking the player as 'dirty' or 'changed' and instead loop over them once per frame during update phase, and then send any corresponding packets (movement, etc)? One of the problems is knowing which player property changed, instead of sending back ALL the variables to the server. When the server sends anything, it can go through this layer and make changes (like update with the player's REAL position, not client-side) without the rest of the classes knowing - although it does fire off events when it makes changes. Doing it this way I found I didn't need to construct any event packets, used for serialization/deserialization and callbacks, instead I could operate right onto the socket stream. Make changes to the world around me client-side, request changes to the world around me to the server-side. The problem is still notifying the network of a change, and efficiently using the network. The easiest thing to do would operate entirely from one interface, ie. SuperMasterClass.ChangePlayerPosition(player_id, x, y) etc. Kind of like C. The component method would be to add a network component to the game object, monitor for x/y changes and whatnot, then notify it's parent during update phase with an event. Similar to callback events and marking the object dirty, but more elegant. So maybe with a callback event to the network module I could construct an event object, add it to it's own loop, and iterate over those during the update phase, and somehow trim them so there's no duplicates (update player position twice). Seems like a wannabe-elegant solution. The component architecture's I've seen look inefficient though (dynamic variables, callbacks, and component lists), maybe too much for a scripting language. Then again using a scripting language I have the benefit of *real* generic/dynamic objects. I just sacrifice some speed and type-safety I guess. The reason I'm giving it thought is not only because it's the base of the game, but because moving around objects and making changes, with it updating on the server database (assuming the player has permission - like me) would be a huge benefit. Like GM privileges, for absolutely everything, like a live map editor/world builder. Long post, I know, but this helped and I think I'm coming towards a conclusion.. I'm really only posting so someone can disagree with something I said and maybe I can learn something or get a better idea. This article's ObjectView's almost match my WorldSession exactly, except I'm stuck on the whole 'keep track of object state' thing. It can be done with components, events, iterating, etc. Written in 2002 o.0 [Edited by - Dae on December 5, 2009 10:44:28 PM]
  6. I'm not entirely sure where to go with my game's control flow and abstraction. This is pretty long-winded, but I'm just looking for more information on game control flow and recommendations (component/event/signals/etc systems). It's 2d, online, and uses the haXe/AS3 scripting language. I've got a main loop which: 1) processes input if there's any changes and fires off events 2) updates the game world, which in turn updates game objects 3) updates the physics scene, collision, etc. 2) updates the graphics scene, and renders graphics objects At the moment the game objects just hold variables to the graphics object (model2d) and physics object. I wanted to use the game objects as mixins of the graphics/physics/network objects, but my language doesn't have that feature or multiple-inheritance. I also wanted to only keep track of game objects, therefore game players and game npc's would have to be game objects. The only thing that seems to match this is a component based system. It would also seem like you'd require a get_type method or something to determine if the game object was a player or npc or something else. Seems like a bad idea, so I've just kept 3 separate linked lists. What I'm using at the moment is a sort of event driven architecture. Similar to events/delegates in C#. Some classes have event objects other classes can subscribe/unsubscribe, and some methods having callback arguments. I don't really know if this is a good way to go about it. Components seemed to accomplish the same thing, except interfaces just added unnecessary complexity compared to events. Meanwhile sigslot seems like too much freedom and chaotic. Then again, it's probably the best way to abstract subsystems and still connect them together without adding dependency. Anyway, I figured I'd make graphics/physics/etc objects abstract or components to the game object, but since I can't, I could make them interfaces, pass graphics object etc to the constructor, and proxy through those. Then I can pass the game object to any of the subsystems (graphics, physics, etc) using the base interface. Maybe I should just keep it straight-forward, even if it's worse in the long-run. :D Thanks in advance.
  7. Quote:Original post by Captain P I've been using haXe for a while now - it's pretty interesting in that it can be used to target Flash, PHP, javascript, Neko (a virtual machine) and C++. Combined with FlashDevelop it's a pretty strong choice. FlashDevelop can also be used to write ActionScript, of course - combined with the Flex SDK you should be good to go just as well. By tossing out the Flash authoring tools, creating vector art and animations is going to be more difficult, but perhaps you can process the output of a free vector-art program (for example, Inkscape), or simply stick to raster art. I've just begun using haXe as well. Not only can you ditch that slow and dreadful Adobe IDE/Flex compiler, but you can develop natively on Linux, and your SWF will come out faster if you take advantage of it's features. It can also output SWC's or AS3 to use in Adobe's authoring tools. I've pondered if you could create your vector art and animations in Flash IDE, and import the SWF in haXe. I believe you can, but it probably has limitations. Oh and to the OP the only options I know of are haXe and Alchemy (Adobe's C/C++ to AS bytecode compiler).
  8. I know this is pretty obvious, but why not just use C++0x? Sure it's not finished, but it should be good enough for any small projects. It's a much needed C++ face-lift.
  9. Dae

    Too much stuff

    Have you ever played Titan Quest? There's a tool you can use with it called Titan Quest Vault, which lets you organize your items into categories / pages. I think if such a feature existed in-game, a tag and search system would be nice. A lot of people (relatively) used that tool too. Trying to collect every item and share their database.
  10. Dae

    3D engine for game....

    Do not do 3D. I don't care how ambitious you feel, I do not recommend it.
  11. Dae


    Thanks Antheus. Yeah, that's why I just wanted to wrap existing libraries. Have any recommendations? Quote:Original post by bobofjoe Site& site = app.UpdateSomething(); Table& table = site.UpdateSomething(); This is very, very dangerous. Right there, you are binding a reference to a temporary, which is Undefined Behavior. You have no guarantee that the reference will be valid - accessing it in the way you do a few lines down can result in a sudden crash of your application. You need to change it so that you hold a copy of the temporary. Thanks bobofjoe. It was just a test, but it was just a test. This is correct then? Site site = app.UpdateSomething(); Table table = site.UpdateSomething();
  12. Hi gamedevs, I wanted to clear my head on the topic of C++ events. There's sigslot, boost::signal, etc. I would still want to wrap any of those so it would be easier for myself to navigate/modify. I stripped down a standalone example to try and weed it out. Up until now I haven't needed events, but I think if I did make a game engine, it would be built around events. Does anybody have any comments, criticisms or improvements? Trying to figure out the best way to propagate up events. I wonder if the syntax could get easier. I'm not fond of having to use boost::bind in the syntax with _1, but I guess that's the only way it could work in C++. At least, without macros? Thanks This code should run. Skip to main(): #include <iostream> #include <vector> #include <boost/bind.hpp> #include <boost/function.hpp> namespace Framework { template<typename T> class Event { private: std::vector<T> list; public: template<typename A1> Event<T>& operator()(A1& a1) { for(std::vector<T>::const_iterator i = this->list.begin(), l = this->list.end(); i != l; ++i) { (*i)(a1); } return *this; } Event<T>& operator+(T& t) { this->list.push_back(t); return *this; } Event<T>& operator+=(T& t) { return this->operator+(t); } template<typename A> Event<T>& operator+=(A& a) { return this->operator+(T(a)); } }; } class Table { public: typedef Framework::Event<boost::function1<void, Table> > Event; Event ChangeEvent; // example void UpdateSomething() { this->ChangeEvent(*this); // fire the event } public: unsigned int id; }; class Site { public: typedef Framework::Event<boost::function1<void, Site> > Event; Table::Event AddTableEvent; Table::Event ChangeTableEvent; Site() { } // example Table UpdateSomething() { Table table; = 1; table.ChangeEvent += this->ChangeTableEvent; // attach event handlers this->AddTableEvent(table); // fire the event return table; } }; class Application { public: Site::Event AddSiteEvent; Site::Event ChangeSiteEvent; // example Site UpdateSomething() { Site site; site.AddTableEvent += boost::bind(&Application::OnAddTable, this, _1); // add event callback site.ChangeTableEvent += boost::bind(&Application::OnChangeTable, this, _1); // add event callback return site; } /* * Callbacks */ void OnAddTable(Table& table) { std::cout << "Added: " << << std::endl; } void OnChangeTable(Table& table) { std::cout << "Changed: " << << std::endl; } }; int main(int argc, char* argv[]) { Application app; Site& site = app.UpdateSomething(); Table& table = site.UpdateSomething(); table.UpdateSomething(); std::cout << "End" << std::endl; std::cin.get(); return 0; } Output: Quote:Added: 1 Changed: 1 End
  13. I'm looking for tutorials on what makes seamless space-to-earth transitions work. Meaning landing on a 3D planet from space. Like Infinity: Thanks
  14. Dae

    To Singleton or Not

    Quote:Original post by jpetrie The advantage here is that your dependencies are very explicit, they're called out. This means you have to think about the cost of that dependency -- you're adding another parameter to the constructor to pass the sound system. Do you really need that sound system? You could avoid taking the dependency by having your API implement callback mechanisms, letting the outer level handle playing the sounds in response to stimuli. This is how sounds are played in response to physics interactions -- Havoc certainly isn't calling your sound system global. Think how much less useful Havoc would be to the rest of us if it did. You can bet they wouldn't be as successful as they are now. It also helps you restrict access to systems, preventing you from using them when they really shouldn't be used. You should not call into your renderer from your sound system, or your sound-related callbacks -- doing so goes back to introducing coupling, which is bad. This helps prevent that. Do you mean Havok? Yes I understand that. I guess in my struggle to understand I have given the wrong impression. I don't support coupling, and I have been working on connecting physics to sound (etc) via events (callbacks) from outside classes (engine). This really doesn't have anything to do with singleton vs global, but it doesn't work in the case of RAII (unless it was some sort of proxy). While we're on the subject, what would you suggest? SoundSystem, PhysicsSystem, etc. inheriting an EventManager class and subscribing to the events with functors? boost.signals? sigslot?
  15. Dae

    To Singleton or Not

    Quote:Original post by jpetrie Repeat after me: Globals are not singletons. Globals are not singletons. Globals are not singletons. Globals are not singletons. Globals are not singletons. Are we clear? Furthermore, where you "share the state" need not be global. I never said they were. I've used global references to my singleton objects. That's why I stated it as such. Meaning: GraphicsSystem& Graphics = GraphicsSystem::Instance(); somefunc() { Graphics.Render(); }
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!