Tag Info

New answers tagged

0

One way to do it is to have the units auto-form formations, and have them attempt to stay in a position relative to the center of the formation. Then, instead of moving each unit individually move the center of the formation around. Here's a basic way to do it using a box formation and simple springs to keep the units at their appropriate positions: // ...


0

I do not know how your units works but I assume that they are like a state machine : Possible states Running to (x,y,z) Attaking (enemy_id) Collecting ressource (ressource_id) If you pay attention at how starcraft approaches this problem, you will find that : If there is space to move in a direction, the charachter moves in that direction. If there is ...


0

Why is Server-Lockstep easier to implement? With a server, you know for sure that all clients are getting the same data on Frame X because the server sends out the data on X frame. If each client got their information from other clients, they would have to first figure out if he has everyone's information. Then he has to make sure that nobody else has ...


2

First of all, I would consider making an ability a component, so that it can be attached to any GameObject: abstract class Ability : Component { public abstract byte Id { get; } public abstract Execute(); } By making the byte id a property, you can easily override the property in each class and give it a unique value, without having to worry ...


0

I think you've misinterpreted the formula. You should review the Section 2.1.7 - The Scalar Product. The dot (·) represents a dot product (or scalar product (please use one of these terms because it's what it is)). The scalar product is defined like this: with vectors a and b, and scalar value s, s = a · b = axbx + ayby And, as defined, it gives a ...


2

You will probably need a hybrid between a btree, and quad-tree. (to get you Googling) A few things to consider when partitioning: -Surface-to-air missiles do not need to test against ground units -Likewise with air-to-surface and air-to-air -Buildings don't move and shouldn't test against other objects; other objects should test against buildings ...


0

Option 2 is most common method. If you concern about the update efficiency, you could do more property compare in the ui update function, and only update properties really changes. // a single state cache for current ui sheet preState = stateCache[stateKey]; // or you can retrieve from ui element to save memory and keep it simple // preState = ...


1

Do not prematurely optimize: it will introduce bugs for sure or make code hard to maintain which will result in more bugs anyway. And because you are working in Unity all graphics caching is efficiently handled by the engine(yes, you can hint the engine by referencing required data in scripts) The whole problem should be taken in the most logical approach ...


2

I don't really get it, you are using polymorphism and then you don't? So far I understand it as the following, you have a base class Ability and derived classes that actually implement the ability. So something like: abstract class Ability { abstract public void Execute(); } class CastMagicMissile : Ability { override public void Execute() { ...


1

You have separate classes for each Ability, although the type of each ability is already defined by ByteID. As such, an "ability" is really just a link between each ByteID and a unique callback. You are unnecessarily defining the callbacks via inheritance. A static Execute() can "index" which execute() to use with only ByteID. In this way, all ability ...



Top 50 recent answers are included