Tag Info

New answers tagged

0

You shouldn't be trying to ensure that all your updates happen after X milliseconds - the existing game loop does that already. Instead, what you should be doing is applying delta time correction to your updates to ensure your updates, no matter how frequent or infrequent, regular or irregular, all happen at the same rate. An example is as follows, and is ...


0

If you are doing everything correctly and there's still clicking (a definite possibility if the sound file doesn't end in faded to silence at amplitude 0), the way in general to address the problem is to fade it out to silence over the last 20 milliseconds (exact length of fade can be tuned to your needs). If you have popping in the beginning, you can solve ...


3

Why not this way? Much easier? damagePerSecond = averageDamage * fireRatePerSecond * accuracy Example: damagePerSecond = 140 * 10 * 0.09


0

DPS = (total / rate) * accuracy; so for shotgun: damagePerShot = 140; totalPerSec = damagePerShot * 10; dps = (totalPerSec / 100) * 9; so I figure average dps of 126 for a shotgun. Sound Good?


4

This is probably the solution for most of the clicking sounds from OpenAL-Soft library. Might be too late after more than year for the person who posted the question but might be useful for others who end up here through Google. I had the same problem of hearing clicks at the end of loops so I tried to figure out where it is coming from. While trying ...


0

One of the strategies I've employed was to make the hardcore players have a real interest in helping and/or mentoring the casual players through the game. Simplest terms would be guild but a more effective version is something like, as you get more powerful in a game you become the ruler of an area and the smaller players actually flock to you for your ...


0

Ok so I found the solution, and thanks for you replies. The linem_player->GameObject::setPosition(m_player->GameObject::getPosition() + dir); was only updating the gameobjects position variable, this variable only took effect on the gameobjects update. Which why of course it worked when there was only one wall. But with a second wall, it would ...


0

if (col.left) dir.x += (wall.getPosition().x + wall.getHalfSize().x) - (m_player->getCollider().getPosition().x - m_player->getCollider().getHalfSize().x); else if (col.right) dir.x -= (m_player->getCollider().getPosition().x + m_player->getCollider().getHalfSize().x) - (wall.getPosition().x - wall.getHalfSize().x);


0

A possible explanation for this is unrelated to the corners: to determine whether it's colliding left or right, or if it's colliding up or down, instead of checking how far inside the player's hitbox is within the wall you should check the direction of the player's movement. It would go more along these lines: CollisionData testPlayerCollision(const ...


0

There is no standard way of doing this. This is purely a marketing feature. The most logical way to do this would be to use the default language of the OS of the mobile device as all mobile devices have that feature. Don't ask the user. Then in the options offer to change the language if you want. You could consider it a hassle, a wast of time and money ...


1

Apart from technical issues, that's something you get to choose for yourself. There are lots of games/programs that use each of those approaches, so you have to ask yourself what gives a better UX for your users. In my opinion: Choose system language: This is my preferred choice. I dare say the vast majority of users use and expect this. Those who want a ...


0

You can ask for language in a new screen. And later the users can change the language when they want, i.e. in pause screen or in main menu. You are free to choice!


3

When a unit/structure/weapon attacks, I would probably create an Attack (subclassed with all your fun details) that takes the attacker and the defender (or defenders). The Attack can then interact with the target/defender (slow, poison, damage, change state), draw itself (beam, ray, bullet), and dispose of itself when it's done. I can foresee some issues ...


4

I don't know a whole lot about Unity and I haven't done game development in a while, so let me give you general programming answer to this question. I have based my answer on the knowledge I have about entity-component systems in general , where an entity is a number that is associated with N many components, a component only contains data, and a system ...


0

I found few documents, that describe the replay file, so from those you can figure out what kind of model they are using for commands etc. They have to use some kind of command pattern. That means, that each command issued is capsuled in instance of command (or ICommand ). Thus, if everything in the game happens with those commands, you could just push them ...


2

They would include that damage (or the data needed to get to the damage value like the RNG state) in the replay information. Each attack is only a numerical value of the damage value, the id of the attacker and the id of the victim. That is 3 values with a limitation on number of units those IDs could be a single byte each. Crucial information is often RNG ...


9

Well, I'm honestly not an expert on this but... I think it depends on how complex and varied you think the attacks will become. Since it's an RTS I'm guessing you'll have maybe 10-50 or so different units or structures with their own attack types. Option 1: If there is a relatively low number of units that will have attacks that are somewhat similar I ...


1

This is very similar to how one might handle Achievements, or Challenges, or any other situation needing you to keep track of a series of events and counters. Simply coding the rules into a scripting language does work. You would need to be sure that all events related to conditions you care about are exposed to the language. You might also need to allow ...


-1

i'll be a bit abstract. Why don't you use a Observer pattern After each turn you call NotifyObservers that invoke the Notify method inside each observer. Every observer is a win/defeat condition. At the start of a stage, you "register" one or more observers.


1

We used hardcoded conditions with some variables in early days. That was working good enough, but quite cumbersome. There were standard objects (houses, army, citizens, time) and deeds (kill, preserve) connected with win/defeat goals. So for example we could have: kill houses of player 5 to win kill army of player 5 to win preserve citizens of player 4 to ...


1

Capsuling game modules in shared libraries has the benefit of reduced compile times during development. If the API between modules is carefully designed, it will not change often. This allows you to recompile only the module you are working on. Shared libraries also allow to be shared by multiple Applications, thus saving disk space (and for a certain ...


2

Here is another way to connect rooms with three doors: Make sure the amount of doors in your level is even. Put all your rooms in the not-door'd set Pick two rooms from the not-door'd set Connect them through one of their doors If those rooms still have a door that has no corridor, put them in a partially-door'd set While the not-door'd set is not empty, ...



Top 50 recent answers are included