Tag Info

New answers tagged

0

You should have two buttons, one for start from 0, one for start from 10. You then check which button he/she clicks. If he/she clicks Start from 0, then he/she starts from zero. If he/she clicks Start from 10, then he/she starts from 10. I don't understand what character.hidden means. Could you provide more context? Anyway the pseudo code should be: if ...


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!


2

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 ...


8

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, ...


4

Imagine dots are doors and lines are corridors. This is how you can have three doors connected: There is no reason why you can't link a door to more than one other door. You can have corridors merge at some point. But oldskool roguelikes didn't even do this; they simply connected random pairs of rooms with corridors, and if they happen to cross into a ...


0

When using the place_meeting(x, y, obj) method, you can provide either an instance or object to check for as the third argument. Your code is checking for obj_cube, and will look for all obj_cube's. What you need are variables to keep track of each individual cube. cube1 = instance_create(x, y, obj_cube); cube2 = instance_create(x, y, obj_cube); Now ...


2

See the answer linked in the comments on your question for a detailed answer. Here is an undetailed answer: Say a character is moving to the right along the x axis. You move it at 1 pixel per frame. In 60 frames, it will be 60 pixels to the right of where it started. If you are running at 60 FPS, it will arrive at its destination in 1 second. If you are ...


6

Typically, a frame is drawn every time through the game loop. Thus, the FPS tells you how fast the game is looping. That said, more sophisticated rendering architectures often decouple the rendering from the main game loop. In that case, the two are only vaguely related.


1

Because stories are subjective and tied to emotion. (The rest of this answer contains daaaangerous TV Tropes links.) Players can become really attached to arguably awkward story or dialogue. They might feel robbed if the details were retroactively changed, without any hope of re-experiencing them that way, regerdless of whether the changes were generally ...


0

Based on this: Counting instances at position I made this script: //script CountColliding(x,y,obj,0); var ret; ret = argument3; show_debug_message(instance_place(argument0 /*x*/, argument1/*y*/,argument2 /*obj*/)) with(instance_place(argument0 /*x*/, argument1/*y*/,argument2 /*obj*/)) { instance_deactivate_object(id) ret = ...


0

Shared libraries such as DirectX have their DLLs installed under DirectX, not in the game folder. Many game projects are divided up into multiple modules, particularly for different types of resources, but possibly also for modules or libraries. Breaking them up is useful for reducing patch sizes, for one thing. However, modules for a particular game are ...


3

Well, for the first part a lot of modern games are coded in C++, which supports namespaces. Namespaces allow you to group a collection of related code within part of a whole. So you could have a collection of namespaces such as 'Render', 'Input', 'AIProcessor', etc (note: I am making these up) Building these subprojects into the main project allows all of ...


1

DirectX is a windows API with a corresponding DLL somewhere in your C:\windows directory, similarly with opengl32.dll. Check with dependency walker in you don't believe me. The rest is probably handled through scripts which don't have to be DLLs and just reside in the rest of the assets.


1

A design pattern I've enjoyed using has two types of things: task management and task execution. Task management asks the question "What should I be doing right now?" And task execution asks, "How do I complete the current task?" Task Managers The job of the task manager is to constantly look at the AI's internal state (read-only) to determine whether new ...


1

The best way I can think of to do this is to have an empty object with a TaskController script. Assuming the NPCs have their own scripts, and you can call a function in their script to have them handle a task, your logic would flow like: Player clicks on light switch Light switch script calls CreateTask(TaskName, Index) on your TaskController empty's ...


2

height map can be the solution? A big b/w image to manipulate the map heights easly wilth an image editor (gimp?). A (selfmade) tool that transform a B/W image (i've done one in c#) into a matrix of floats and save/load it to file concerning your needs. If you need a memory buffer to keep a small part of your big file map , you can consider an aproach ...


1

Use tile editor to create the map. Normally those allow you to export the map in some format. Then create map loader for that map, that reads the exported file and create object from it, to your game. If you have to use ascii, split those to sections so that "first town" would be saved to txt file "firstTown.txt" and that would contain the number-to-tile ...


1

You can use an image. Each pixel will be a tile and each 32bit color will encode several values like alpha=0 means impassible. Then you can use any image editor that allows you to save in a lossless format and choose the exact color values.


0

Time delays are usually not a good idea because you can't go below zero. Also keep in mind that differently powerful systems will take shorter or longer to execute your actual game-loop without the artificial delay. When you want the game experience to be independent from the power of the users hardware, get a time measurement at the beginning of your ...


0

your calculations should go into the update method. it's fine to have an AIManager class, that has an update() method itself which gets called in the main update loop. this AIManager could hold a list of all the Objects that need to be updated. Since you're using java, you could use an interface to declare something to have an AI, and use this interface to ...


0

That's how I do it in my 2D fighting game: The characters object holds only their physics values (position, velocity, acceleration and friction). Each character contains a set of states (standing, jumping foward, jumping back, weak punch etc.) When a character change its state, the 'Initialize' method of that state is executed. Inside it I can set the ...



Top 50 recent answers are included