Hot answers tagged

22

In an average game, there are hundreds or maybe thousands of obects in the scene. Is it completely correct to allocate memory for all objects, includiding gun shots(bullets), dynamically via default new()? That really depends what you mean by "correct." If you take the term quite literally (and ignore any concept of correctness of the implied ...


21

What you want is to constrain the camera viewport on portrait or landscape(depending on your needs), by computing camera.orthographicSize property, so you can build your 2d scene regardless of aspect ratio and resolution: // Attach this script on your main ortohgraphic camera: /* The MIT License (MIT) Copyright (c) 2014, Marcel Căşvan Permission is ...


17

As far as scripting languages go, Lua is very fast, but like anything it varies depending on the processor. For example, Lua would not be great on a console platform because it tends to be very branchy, and some console platforms branch very slowly. To best answer your question, I would suggest running some benchmarks. See how fast Lua performs some various ...


17

Both solutions (drawing on your canvas VS. traditional HTML/CSS) are totally valid and will work just fine. Some things to consider: If you're already using a canvas-based library, your code may be cleaner/more organized by continuing to use canvas instead of having additional (DOM-based) methods for UI. If your UI is extremely text-heavy (with dialogs etc....


15

There are quite a few resources to refer to. First thing to note is that 93% of the top 100 grossing games use in-app purchasing so that by itself means something. Here is a research by flurry showing the dominance of in-app purchase dominance as a monetization model for mobile games. This is from about a year ago and the trend became stronger since: Part ...


14

Unfortunately, the answer is to draw less. I've found the bottleneck with canvas based applications (on any platform, really) is the time it takes to actually draw pixels. Here are some things to try: Use several canvas layers. Draw your background to one layer while drawing your objects to another layer (absolutely positioned on top of the background ...


13

If it's not a "real time" game in the sense that players don't need to see the immediate result of another player's actions on a game scene then you should be fine with HTTP requests. But Keep in mind the overhead of HTTP. That said using HTTP will not save you from designing your communication protocol with care. But if you are in charge of both the server ...


13

You want a better communication protocol then HTTP. You probably want UDP or TCP. Browsers have no way of doing UDP communication so your only choice is TCP. For TCP you would want to use a WebSocket, however browser support is unstable on websockets. This means you would need to use a COMET technique to emulate TCP, one popular emulation would be a ...


12

Just as @JustSid said, if you move from one cell to another the handover is handled transparently. The 3G network is just the method of transportation of your data packets, therefore it is a few layers below the IP layer, if you think in terms of the ISO/OSI stack. I worked on a push-to-talk application for mobile phones and all i can say is, that we never ...


11

Unity is probably your best bet, it supports both iOS and Android, as well as Windows and Mac.


11

You will probably need to micro-manage the 3G modem to ensure that you don't have delays while it switches power modes. Your simple answer is make sure you send at least one packet larger than 128 bytes every 6-8 seconds. If you can guarantee that all your packets are smaller than 128 bytes make sure you send something once every 6-8 seconds. Avoid, at all ...


10

They are typically called mobile games, which covers a game that runs on a mobile device. This is distinct from console games (Xbox, Wii,...) and PC games. In addition, most mobile games (but not all of them!) are casual games.


10

For iPhone / iPad development, you are going to need a Mac. See Tetrad's comment for relevant "Can I use a Hackintosh" discussion. For android development the development tool is the same, it is the Eclipse IDE, and it is available across all three primary OS choices. You can find the relevant information about it here: http://developer.android.com/sdk/...


10

If you really want to have your options open, just buy a Mac. You could always bootcamp it into Windows if you really need to be on the PC side of things. That way you get a proper native iPhone dev environment, and a really good Android environment (since, like was already said, it's very Unix-like). And the option to switch over later if you really need to....


10

Take a look at this article about the networking architecture of Age of Empires II. They managed to create a multiplayer game that ran great on a Pentium 90 with 16 MB RAM and a 28.8 kB/s modem connection. They did this by having each player run their own simulation, but synchronize their commands. They have some clever tricks in there, I highly recommend ...


10

Problem analysis Real-time communication over a high-latency connection is obviously impossible. You can of course attempt an illusion (as you're doing by making the remote player appear to have passed an obstacle when it's not yet known). When that illusion fails (as yours does when the remote player didn't actually pass the obstacle, but died instead) ...


9

HTML5 and JavaScript are getting better every day. They may not have as developed toolchains as more existing platforms, but in six months or a year they look to be pretty strong. The main advantage is that you can code and test by making a browser accessible webpage and navigating to it from the mobile device. Additionally the platform specific differences ...


9

It heavily depends on the game, but some friends and I were thinking about the same issues only a couple months ago, and here's what we determined. I'm in a pros and cons mood again. Computer Based Server Pros Tried and true Scaleable Cons Need to write a "multi-server" that can host multiple games at the same time. This will likely use slightly ...


8

The internal system we used for Moblox (later replaced with OpenFeint) worked like this: Send a JSON message over plain HTTP (not HTTPS). Include a MD5-hash of all fields plus a magic string. On the server, check the integrity of the message with the same operation. To crack the system, you'd have to find this magic string. It is possible with reverse ...


8

You can limit the most flagrant of abuses by monitoring the highest results in the top score table. Depending on your game, you may have a "perfect score," above which any score must be fraudulent. If not, you can calculate the lowest "impossible score;" can the player shoot 10 shots per second, the game lasts 1 minute, and each killed enemy is worth 100 ...


8

I have little experience about this topic but by logic and knowledge I can give a few pointers that might be worth a few pennies. First of all: those two markets are big, I mean really big, maybe, just maybe, too big for you. This is good as you have a large target audience, but the size already has attracted many many many (you are not the only one, no) ...


8

There are arguments to both options. Single Currency - usually simpler for players to understand Multiple Currencies - allows more flexibility to in future optimizations For a single player action game I don't think you need more than two. Three of four currencies is something that is usually reserved for resource management games where you actually gain ...


7

There are a ton of options for this, so it really depends on your budget and long term hopes. If you're planning on just making a one-off, then something like MonoTouch, Flash and Unity would be perfectly fine. If you want this code to be something you can grow and own yourself, then writing your own C++ layer that works with OpenGL on both platforms would ...


7

Lua's C implementation is specifically designed to run on embedded devices. It's small and fast (for a scripting language). I would have thought it was fine for at least light tasks.


7

This is very opinion based. But if you already have XNA experience, and you don't want to learn a new language, seems reasonable to stick with that. (it also has a great IDE..Visual Studios!, imo)


7

I don't have much to add to Josh's excellent answer, but I'll comment on this: Should I create any memory pool for dynamic allocation, or is there no need to bother with this? There is a middle ground between memory pools and calling new on each allocation. For example, you can allocate a set number of objects in an array, then set a flag on them to '...


7

Since you won't risk your own time, or your own money on it, your idea hasn't totally convinced even you. I doubt you will find anyone else to sell it to. This is a very common line of reasoning. Paul Graham wrote an essay on the topic. People ... overvalue ideas. They think creating a startup is just a matter of implementing some fabulous ...


7

(Ignoring statements like "Java is clearly a more powerful platform") Short version: The focus is on Javascript because that is the whole point of the HTML5 everything. To allow browsers to do things like play video, audio, and render graphics without needing a plugin for it. The biggest problem with Java as a browser game option is simply that there isn't ...


7

The HTML5 libraries are surprisingly good especially considering its young age. There are solid 2D/3D engines that support particle effects, physics, and the like. However, there is nothing comparable to established and mature game engines such as Unity or the Unreal Engine. Also HTML5 libs in my experience like to be event driven. For example sprites will ...



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