New answers tagged

0

I am no game designer or have any qualification but I have an idea for a realistic tactical semi turn based ship to ship combat system. Ideally it would be full 3d movement but it is likely easier to explain in 2d. So you would have the area of space between the 2 ships. This is measured in light seconds. Therefore at the start lets say there is a 120 ...


0

For people who come here from Google (like me), the shader version is: fract (tex_coord.st) this will loop coordinates in range 0.0 - 1.0


2

There are a better solution to get 60fps, set vertical syncronisation (vsync) to true when you create Irrlicht device //Here is the easiest common function to create irrlicht device irr::createDevice ( video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE, const core::dimension2d< u32 > & windowSize = (core::dimension2d< u32 >(640, ...


1

One possible solution could be to use weak_ptr. A weak_ptr is like a shared_ptr, except it doesn't keep the object alive. If there are no shared_ptrs pointing to the object, it will be deleted, and then any weak_ptrs will hold NULL. You can use the lock method to get a shared_ptr from a weak_ptr. Example use: shared_ptr<Thingy> s = ...


7

At the moment I'm using std::shared_ptr to support multiple ownership of GameObjects so that they are held by both the scene and any other GameObjects within the game Don't do that. shared_ptr is often the wrong tool for the job, and that certainly applies here. Remember that smart pointers are for managing ownership; shared_ptr is about sharing ...


2

I see a couple of options: Have the Scene refuse to destroy a GameObject if the ref_count of it's shared_ptr is more than 1. This will oblige your users to take a great care of what happens. This might not be very fun or practical, though. In your GameObject architecture, add a listener pattern: when GameObject A links to GameObject B, tell B that A is ...


2

Amit Patel wrote a great entry all about hexagonal coordinate systems at http://www.redblobgames.com/grids/hexagons/ and I strongly encourage you to read through the whole thing for a deeper understanding. A system he mentions in there that happens to be my personal choice for such systems is the Cube Coordinate system; In this system, three numbers are ...


0

It does not matter! You said you load the file at the beginning of gameplay. I infer that it's being loaded during the loading screen. If you have a sufficiently slow HDD (e.g. in a low end laptop from 2008), parsing a file is still faster than reading it from disk, no matter which format you use. Even if you later have to change it, this is where proper ...


0

If you are familiar with Android's UI design, and its properties, it is pretty easy to program something for yourself. So if you want to learn to design a pretty UI, study Android. It doesn't matter game UI or not. It's same thing. I recently made a ListView. I haven't tried it yet. So it is incomplete. But there is some rules, every UI element should obey. ...


0

Try some video tutorials online. LWJGL is several times more difficult to use than LibGDX and I got relatively good at it through ThinMatrix's video tutorials. Hearing somebody explain why something is part of the library, as well as how to use it, with the example, is extremely helpful. The following goes without saying but: don't copy or fully ...


2

One possible way to decouple this example would be to use a stack of event handlers. Your program can iterate the stack in order, trying each listener until one handles the event: class MenuState : public IKeyListener { ... boolean OnKeyEvent(const KeyEvent& keyCommand) { if (keyCommand.Key == Keys.Enter && keyCommand.IsPressed) ...


7

Input is hard. Most of the simple patterns you see frequently in game dev just don't work well for input, at least at the low level. Typically, for any kind of GUI, you need to have some concepts of focus and possibly also bubbling. The HTML/DOM model here is a good resource. In such a setup, there is a sorted queue of event listeners. For a GUI, this ...


1

http://unity3d.com/unity/faq What happens if I/we make a game with Unity Personal Edition that earns more than $100,000? To continue using Unity you would have to purchase a Unity 5 Professional Edition license, which you can do in the Online Store or through your regional Unity sales representative.


0

As Ophir Prusak points out, Apple does not allow downloading code to your app. So one possibility is that you could make your game logic and behavior entirely data-driven. Then all you do is download new data to the app, and your game changes. This is not a simple solution, however.


0

Most API's don't do much processing. It's best done in hardware or in a device specific driver anyway. There's too much variety in hardware to create the one true processing method. That being said, at the application level most joysticks will need to be processed the same way just to different degrees. Filtering Most modern joysticks have little to no ...


3

If your goal is to have quaternion that expresses rotations, and if you want to do operations with them (for eg. rotation composition by multiplying quaternions or convertion a quaternion to a rotation matrix), they must be unit quaternions, otherwise you may have unexpected results. Quaternion normalization is a relatively costly operation involving ...


0

To answer your question, it's perfectly safe and common to let other functions (in potentially other files) update or draw parts their responsible for (or everything if you'd like that). The important thing to keep in mind is that drawing things to the screen outside of the love.draw() function, or functions called from that one, will have no effect, because ...



Top 50 recent answers are included