Tag Info

Hot answers tagged

25

Port your engine to each platform. There's nothing special about it. If you have some code that is Windows-only, then either add some #ifdef logic in the file or add a second file (so you'd have FooWindows.cpp and FooLinux.cpp or whatever) that implements that feature on the other OS(es) you care about. The one-click publish stuff that an engine like Unity ...


22

I don't know how old that writeup is, but I'd say it's pretty old. In modern Windows (XP and newer, but specially on 64-bit versions), I would say doing something like that will have little to negative impact on the startup of your game. First of all, remember that the address space is virtualized for each process. As far as your process is concerned, you ...


13

There's no magic bullet here. If you want your game to run on multiple platforms, you have to write code for multiple platforms (or leverage third-party libraries that already do this for you). The things you are asking for don't align: you say (emphasis mine) what I am looking for is resources to integrate something that will allow me run on ...


9

One thing that pre-allocating a large chunk of memory could do, if your computer was low on RAM, might be to force the OS to free some extra space by swapping parts of other programs' memory space to the disk. Since such swapping is generally a very slow operation that pretty much freezes your program while it's happening, there could be some advantage to ...


5

You don't speed up the engine, you speed up your units and their actions. For example, when you update an enemy, you usually do something like enemyDirection * enemySpeed * timePassed to get their new position. Now, if you want to double or halve the speed of gameplay, you just add this in as a factor: enemyDirection * enemySpeed * timePassed * ...


2

In your loop you probably have vsync on, or other stuff like "wait for input" that limits your cpu usage because the program have to wait for other tasks. When you "freeze" your application it becomes just an infinite loop. If you lunch the following program int main() { while(true); return 0; } of course it won't terminate, and its cpu usage will be ...


2

I ended up with a simple idea that worked surprisingly good, so here it is: In my particle engine, I generate n particles per gameloop tick, and running at 60 FPS we have, for an elapsed time t in seconds, n * 60 * t particles generated. This could vary if your game isn't fluid and frames drop, but we assume it runs correctly. Now what happens is that the ...


2

YES. If we put cross-platform aside, I think you should use a game engine just for the basic features that many game engines provide: Object/Layer management + Level loading A Renderer for either 2D or 3D Texture management (texture groups, texture sizing, texture-atlasing) Physics Animation engine (support opacity, rotation, position, etc.. with different ...


2

The solution can be pretty simple - just add a field or flag and dont release until n bullets of your burst have been fired. in weapon: int burst = 0; when hadling event: void onFireButtonPress() { //previously simple fire(); burst = burst > 0 ? BULLETS_PER_BURST : burst; //or some other behavoiur like burst += 3 etc. } in game loop: ...


1

I'm building a cross-platform game engine at the moment. I'm using SDL, which is an excellent (and suitably low level) cross-platform library for building graphics applications, to ease the pain. Beyond this, though, is a lot of "custom code" for each platform. This you just have to get through. I've found it to be a very small fraction of my development ...


1

Contrary to the other two answers (which are rightfully C++-specific), there is another way. Some architectures that come to mind: Port your engine: Modify or write code so that it works across multiple platforms. This is addressed in the answers above. Write something above a cross-platform library: This is the example of libGDX, which runs on Java. Java ...


1

As you mention that your current game is simple I assume you are learning, or at least expanding upon other non-game related knowledge. Game engines are useful tools in industry, the games you make will work more efficiently and turn around time will be faster. My opinion is that it is far better to create your own engine if not working on a commercial ...


1

It's not clear to me exactly how you're handling this now, but in C# with Unity you can use Events to get the job done. For example, you'll create your event handler (it doesn't have to follow the object sender, EffectEventArgs e format if you don't want it to): public delegate void HandleAbilityEvent(BaseAbility ab, Unit caster); This is a delegate ...



Only top voted, non community-wiki answers of a minimum length are eligible