• Create Account

# Paragon123

Member Since 02 Oct 2013
Offline Last Active Yesterday, 02:45 PM

### In Topic: Applying Mathematical Functions and creating game Formulas

Yesterday, 10:37 AM

Writing a formula is a bit like writing a sentence... it can be long and complex or short and simple, there are multiple ways to express the same thing, you can have two nearly identical expressions with two vastly different results. I don't think there is any way to algorithmically generate expressions that give a specific output, you have to build each formula on a case-by-case basis.

Find a formula with the basic shape you want. Linear, oscillating, tappered, bell curved etc... doesn't matter.

take

To raise or lower a constant distance  Y=f(x)+c

To shift right or left a constant distance Y=f(x-c)

to stretch/shrink along the x axis Y=f(x*c)

to stretch/shrink along the y axis Y=f(x)*c

to travel the oppiste direction on the x axis Y=f(-x)

to travel the oppisite direction on the y axis Y=-f(x)

a generic formula which can apply or not apply some transformations

Y= (Y_Reflect/abs(Y_Reflect))*(Y_StrechCoefficent)*f((X_reflect/abs(X_reflect))*x-x_shift)+y_shift

When Y_Reflect<0 reflect vertically, when Y_reflect>0 don't modify output, when Y_reflect=0... function falls apart... constant output of 0

When X_Reflect<0 reflect vertically, when X_reflect>0 don't modify output, when X_reflect=0... function falls apart... constant output of f(0)

Of course this only works if you already have a function in mind that you want to modify in some way

### In Topic: Coding-Style Poll

27 September 2016 - 08:34 AM

I can't stand it when braces are not on their own line, it is too easy to miss one when the line is wider than the screen and matching braces by column is incredibly easy.

Class names, and public properties are Capitalized

Parameters camelCase

local variables don't matter as long as they are not  capitalized. starting with an _ is also acceptable (to me)

private variables holding the data to a property is the same name as the property camelCased with a proceding _

```public class Foo
{
int _count;
public int Count
{
get
{
return _count;
}
set
{
_count=value;
}
}
}
```

The only time i use specific prefix or suffixes are with GUI elements, event handlers and delegates.

User controls are prefixed with an _ and have a suffix indicating the type of control.

Events are suffixed with EventHandler

And delegates are suffixed with Delegate

Tabs as spaces is always better (IMO) than tabs as tabs.

I like to ensure that all parenthesis are explicit (unless the expression becomes unreadable because of it)

I work in .net mostly, switching between VB.net and C#.net, I can not stand VB implicit parenthesis for subs without parameters... myObject.ToString just drives me up a wall compared to myObject.ToString()

When in doubt I try to find it here https://msdn.microsoft.com/en-us/library/ms229002(v=vs.110).aspx

### In Topic: Visual studios 2010 debugger variable doesn't update

26 September 2016 - 09:31 AM

Is the value black or red? Vs will set values to red when it knows that the value may be out of date... However, I have only seen this happen when showing the value of indexers.

Did you try deleting the watch and adding a new one?

Is there any possibility that the variable name is shadowing another variable by the same name in a parent object?

If you add an arbitrary variable in the same scope as the loop does that value update correctly?

Have you tried closing visual studio, deleting the Obj/bin directories and deleting the .sou file?

### In Topic: Biome based map generation?

22 September 2016 - 09:08 AM

The advantage of using a heightmap/temp/moisture/etc method is that you won't end up with a polar region at the equator or a polar region and a dessert region directly next to each other.

I want a technique that can result in a mountain with a lake to the north, a forest to the west and a dessert to the right.

Lakes/rivers... pretty much any water related feature is generally (I think) not considered a biome and added "Ontop" of any biome already in place. I am going to assume you mean to say that mountains, forests and desserts can be adjacent rather than specifically in a north/west/east orientation... do you want to enable polar regions to be next to desserts? or rainforests at the poles?

For my implementation I am using the Heightmap method for placing a base biome,but then I plan on giving each base biome a random chance to morph into a specific sub biome of that base type... for example, the height map method may produce a region that is polar... I will then give it say a 20% chance of becoming one of either a Frozen Forest, Ice caves,hot springs, yeti country, or... I don't know... blue dragon graveyard or something. This way any area that implies it should be cold will be on a location on the planet where it makes sense to be cold but there will still be variety.

### In Topic: Mines here and there

12 September 2016 - 08:11 AM

You can make it such that stepping on a mine doesn't necessitate stetting it off.

First, there might be an 80 or 90% chance of setting off the mine by stepping on it unaware, but if the mine is marked the chance of setting it off could be reduced to 10% or something... then you could have enemy units that are able to have a chance of detecting a mine and marking it for other units...

Another choice that could be used to get through mine infested areas if for the enemy to send a mine resistant unit in the front.

You could also mark areas as dangerous when a mine goes off to trigger units to weigh the use of roads in that area less heavily...

If you set it up such that mines that explode nearby mines you could reduce the effectiveness of  clustering large amounts of mines.

I don't know how Dwarf fortress implements it internally, but some units have a tag that allows them to dodge traps and I think most units are able to safely bypass known traps...

maybe you could look into how that system works.

PARTNERS