Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 May 2011
Offline Last Active Yesterday, 02:08 PM

#5224257 how much xamarin and other cross platform api,s are good?

Posted by Waterlimon on 18 April 2015 - 07:20 PM



It says on iOS its compiled to a native ARM executable ahead of time, on android it doesnt explicitly say that (see this stackoverflow answer for reasons why). And it says ("your Xamarin app is compiled to a native binary, not interpreted") without specifying which platform, so both probably.

#5222675 How to create a circular orbit and an angry bird space like orbit ?

Posted by Waterlimon on 11 April 2015 - 05:55 PM

For the 'orbital decay' due to atmosphere (2nd problem), you can just apply some drag if the object is in the atmosphere.


Calculate the resistance force and apply it in the direction opposite to the velocity vector (as in slow down using that force)




drag = objectCrossSectionalArea * objectSpeed^2 * airDensity * someConstant


where airDensity is a function of distance from planet center (or surface, doesnt really matter), see wiki article (seems complicated, so maybe you can just try a few simple functions like constant, linear, exponential etc. and see what works best).


You might want to not apply atmospheric effects above a certain altitude (define some cut-off point), so anything above that altitude wont be slowed down due to atmospheric drag.


A simple model would be constant air density + cut-off at some height (like in that angry birds pic, you could draw similar 'atmosphere circle' with constant air density inside and no air outside), which might be how angry birds does it.

#5222614 inifinite mass and a jitter problem

Posted by Waterlimon on 11 April 2015 - 10:35 AM

Need more specifics.


What do you mean by 'jitter'?


Post the collision detection/response code as well (or describe it carefully).

#5221850 [HLSL] Decreasing Shader Model from SM5 to SM2 (vs_5_0 to vs_4_0_level_9_3)

Posted by Waterlimon on 07 April 2015 - 09:13 AM

Less bones! :)

#5219612 Logo Feedback

Posted by Waterlimon on 27 March 2015 - 08:40 AM

Yeah, anteater was my first impression as well.


But the way its curled up in a ball or whatever doesnt really tell me much...

#5212294 problem with circular resource movement in strategy game

Posted by Waterlimon on 22 February 2015 - 11:51 AM

Do not write the same data you are reading, or at least write the system such that the iteration order adds no directional bias.


You can do this by double buffering the relevant game state.


A more memory efficient method, if you can guarantee that you only read data from adjacent tiles and write to the current tile, is to go on a row by row basis, and BEFORE writing to a row, save that entire row in its 'previous state'. Use that saved row for the reads that access that row when processing the next row (instead of reading the 'new state' you just wrote to that row!). And when processing the row itself, use a similar method for the other axis, as iterating from start of the row to the end of it.


Basically, make sure you are only using previous state when calculating the new state (you can forget the previous state when you no longer need it to save memory, and you dont need to save a copy until you are about to update it with new data).



This issue is usually discussed together with grid based fluid simulations (since iteration order bias can cause fluid to prefer to flow in one direction).


Another 'hackier' solution that is probably easier to add, is to change the iteration order between each update, such that the bias will even out over time. In your example, this would mean that sometimes you get that lock situation, but sometimes dont, so it still works out. This solution causes your simulation rules to be somewhat 'nondeterministic' or unpredictable, so take that into consideration.

#5210921 Different factions or different units

Posted by Waterlimon on 15 February 2015 - 10:22 PM

Factions can be there for two reasons. Either story forces you to have them, or they exist to give the game more content.


If youre not forced to have factions, I wouldnt have them. If you want to give players a big "A, B, or C?" decision, just do it at the beginning of the match based on for example what type of factory the player builds as the first production building, or a similar big choice that you cant really undo or youll be weakened.

Importantly, doing it ingame allows for more possibilities. Ingame, you can easily combine many decisions to give a ton of permutations (do I start with two tank factories, or one tank and one robot factory, or one plane factory and then save the remaining resources for later etc.). With factions, you can have only so many (=very few) options until it gets messy, AND its probably a lot more work for factions anyways, because you want them to look different and so on.


In that sense, choice of faction is no different from any other gameplay decision, except its usually costly for you to implement and balance, and offers very little extra depth to the game in comparison to adding some other game mechanics that offer far more options for far less cost.


Basically, if you COULD make factions be a decision of which is the first building you start with, do so. This gives you the freedom to make the system more interesting. If you choose your faction from a list at start of match, its very difficult to expand on the system. If you keep it ingame, you could lets say change faction midgame. Or belong to 4 factions at the same time at endgame. Treat it as not being different from other game mechanics.

#5210353 best and fastest way to understand a code written by some one else

Posted by Waterlimon on 12 February 2015 - 03:39 PM

Someone else who was trying to understand a big messy codebase in another thread benefited from documenting the code himself as going through it.


So create documentation for it as you read through (assuming you understand it to SOME extent)?

#5209721 Bug when dealing at around 1,000,000.0f of coordinates

Posted by Waterlimon on 09 February 2015 - 07:40 PM

Read about how floats work.

Probably just the limited precision causing issues because youre dealing with big numbers.

#5209024 Filling in the gap: What to do while waiting on the game to finish an action ?

Posted by Waterlimon on 06 February 2015 - 04:47 AM

Maybe add a general planning mode where you can place stuff to be built without having to commit to building them until you realize the plans.

Similar to orders I guess but not as concrete.

You can also add small things like scouting or doing mini ambushes with a few troops if you havel the time to micro them.

Adding customization of all kind could be fun so you can spend free time making your stuff look more badass by adding decorative spikes and stuff.

In my own experience the free time is needed to think of your next move or try to predict the enemy. So in that sense, dont make a game that plays out the same every time, so people needed all the time they can get to process the novel situation.

#5208450 Issue using 2D depth texture array and regular depth texture in same shader

Posted by Waterlimon on 03 February 2015 - 01:59 PM

err... update drivers?

#5208217 oblem with OpenMP for loop

Posted by Waterlimon on 02 February 2015 - 10:51 AM

This says the drawline operation is not guaranteed to be thread safe.


So you probably shouldnt be doing it anyways (applies to all drawing to the same graphics object instance thing basically).



If performance is an issue you could see if the methods that can draw multiple lines are faster, or switch to a modern GPU API to do the rendering in a HW accelerated way.

#5208082 Forward declarations of classes :S

Posted by Waterlimon on 01 February 2015 - 02:56 PM

You should include the forward declaration in all the files that need them. Dont rely on it implicitly being forward declared in some included header file (that just creates a confusing dependency that makes your stuff break if you remove the include, and it wont be as clear that its only a forward declaration of player that is available and not the full declaration).


Assuming what you need is the forward declaration only.

#5207275 Second programming language...

Posted by Waterlimon on 28 January 2015 - 03:33 PM

Learning Lua could be useful too, since you can use it as a lightweight scripting language with C++ and the language is quite compact/elegant so it should be easy to learn.

#5207064 How to easily detect walls within a sight map? (FPS - Eye of the Beholder st...

Posted by Waterlimon on 27 January 2015 - 10:33 PM

In this particular case, easiest solution would be to add a function getReverseDirection() to return north on south, west on east etc.


Then your checks would just become a check to see if the reverse direction is not wall and another check to see if at least 3 of the 4 surrounding cells ARE wall.

So 1. check each direction if there is a wall, and increment a counter by 1 (count surrounding walls)

2. check that the direction behind you is not a wall

3. If in 1 you counted 3 walls (or 4 I guess), then because of check 2 it follows youre facing a dead end



I often try to use integer vectors (int x,y thrown in a class) to represent directions (0,1 / 1,0 / -1,0 / 0,-1) since its easier to do things like "get the reverse direction" or "get the adjacent position to player" using nothing but math (with enums you end up with a lot of conditional logic). Also I usually have an easy way to iterate over all directions (simple way to do that is to just have a vec2 allDirections[4]; around to use in a for loop)