How do you do ? to create space

How do you do ? to create space

Post just about everything that isn't directly related to Spring here!

Moderators: Moderators, Moderators

Myrias
Posts: 9
Joined: 05 Nov 2011, 08:43

How do you do ? to create space

Hi, i am learning C++ and i understund pretty well how it's working.

asigment, pointers, type and size in bits of different values, loop, mathematic operation, objets...

i can read the code and understund what it mean, what it do in mathematical ways.

what i did't understund, or perharps i just did't read this part is how you create the notion of space, angle, lenght.

easy to say, x=2 is 1 after x=1, but what about he is 1 meter more far in this direction
and those two are 2 vertice who make a edge, and those 3 vertice form 3 edge who form a face. and what look like a face.

near bottom (machine) i undertund, near top i understund, but betwen how you create the spatial mark, i did't find yet.
0 x

zwzsg
Kernel Panic Co-Developer
Posts: 7019
Joined: 16 Nov 2004, 13:08

Re: How do you do ? to create space

x,y,z

In mathematical way it's called cartesian coordinate system.

From what I've seen Spring source code mostly use the type float3 which is an array of 3 float. One float for each of the cartesian coordinate.
0 x

Myrias
Posts: 9
Joined: 05 Nov 2011, 08:43

Re: How do you do ? to create space

how do you tell to the machine what is x, y, z.

you use it but how you create it.
how do you define what cartesian coordinate mean.

not in word to me i know what is it, but to the machine.
0 x

Andrej
Posts: 176
Joined: 13 Aug 2006, 18:55

Re: How do you do ? to create space

Let me first state that I read your post about 7 times and have no, I repeat NO IDEA wtf you are asking or what is the expected answer. But I promise to try and give it my best:

Due to the inherent analogue, continuous, nature of the universe, several important concepts such as 'space', 'time', 'faith' afford manipulation by mere mortal being only within limited bounds. The act of Divine Touch (Demoted to dull gray commonality with the lowly labels such as 'Ability' given by the acolytes, led astray by the pseudo-religioous manifests of 'science' and 'engineering') of creation forever remain the sole domain of 'God'. For a man-made construct such as the vector-computational apparatus to reach into such inner spheres of influence would be the ultimate heresy.
In order to induce traumatic rot into the humble god-fearing American family as we know it, no external force will suffice, the Jews are thus forced to act from within. Holding the seductive mirage of
transcendence by use of Sionist concepts of symbolic manipulation in sight, they have introduced their religious tokens into nigh every of a household of today. The uninitiated might pass off the dominating beige quadrilaterals, the intricate spiderlike wire patterns, the flashing light panels as harmless attempts of Satan competing for our attention, but to the True Believer, such pagan idols immediately stand out in their true form: A platform for muscling display of their masters manipulating might.
Despite the direst attempt to hold their ranks however, their false prophet leaders have made a grievous miscalculation however!
Inherent within their design, such machines operate slave to limitations of their primitive design obeying the abstractions of 'control' and 'state'. By (Temporarily) her interaction to the ripely exposed 'man-machine interfaces' a, and any, soul Brother is imbued with the ability to inject Order into the Chaos cleverly deposited into each and every such contraption. Turning the tool against its maker in its full irony. Infusing this sacred Order, we are planting a seed of our own image, if you will, entering a part of our Ghost into the machine's shell, subverting it in His name. Thus we link the inorganic matter with the Holy realm, enabling us to conjure a small scale specialized manifold - 'Creating' a 'Space' - a private plane no thought of the unbeliever may enter, if you will. Such feat is clearly achieved through unison of both the spiritual and the physical.

If you do it right it should look about like this

I hope with this tutorial, representing the Spring community expertise we have developed a way to communicate the Tool a class of concepts at least as wide as the one you are asking for, achieving the Goal.

Anonymous et. al. On Finitism and the Freemasonry movement (2011)

/prog/ seems a remarkable fit of the mental frame in general, so I have taken the Liberty to repost Your question: http://dis.4chan.org/read/prog/1320732162/1-40
0 x

knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: How do you do ? to create space

If you mean the whole scale thing, then one just defines 1 pixel=1cm (for a 2d game) and sticks with that. Though usually it is a good idea have "internal" coordinates and when drawing the screen make it independent of screen resolution.

With 3d it is a bit more complicated when you render it to screen but the physics part is kind of the same. The limits are how big numbers you can store in your variables and their accuracy. (ie in space flight games like kerbal space program)
Or minecraft: http://notch.tumblr.com/post/3746989361 ... ion-part-1

also maybe this:
http://blog.wolfire.com/2009/07/linear- ... rs-part-1/
http://blog.wolfire.com/2009/07/linear- ... rs-part-2/
http://blog.wolfire.com/2009/07/linear- ... rs-part-3/
http://blog.wolfire.com/2009/07/linear- ... rs-part-4/

For spring:
http://springrts.com/wiki/Units-UnitsOfMeasurement
notice how for "angles" there are multiple defina oh never mind, Andrej explained it better
0 x

Moderator
Posts: 2445
Joined: 12 Oct 2007, 09:24

Re: How do you do ? to create space

how do you define what cartesian coordinate mean.
How do you define what anything means? No code has meaning beyond how people interact with it.

0 x

Myrias
Posts: 9
Joined: 05 Nov 2011, 08:43

Re: How do you do ? to create space

You guys love so much trooling,

this was enought "Units are implicit to the code. You decide on what unit to use and enforce it by convention. The code you write provides the semantics or meaning to the values. Computation in the end doesn't care about units, just that your input and output data is consistent. "

it said, every mathematic operation you made with x,y,z define by itself with the purpose of the operaction.

so it's not calculation who are based on, x,y,z but x,y,z who are implicit by the calculation.

so no need to define, just use it like it already was.

now i go back work on map damage code.
0 x

smoth
Posts: 22300
Joined: 13 Jan 2005, 00:46

Re: How do you do ? to create space

Myrias wrote:You guys love so much trooling,

you have no idea what it is to be trolled.
0 x

Moderator
Posts: 2445
Joined: 12 Oct 2007, 09:24

Re: How do you do ? to create space

Barely any trolling at all. We're confused as to what you meant.
0 x

zwzsg
Kernel Panic Co-Developer
Posts: 7019
Joined: 16 Nov 2004, 13:08

Re: How do you do ? to create space

I would guess that Myrias is too young or too dumb to have had the math courses we all take for granted around here.

If was ten years old, or if I was into social study, I suppose I would be as well quite ignorant of geometry, trigonometry, vector analysis, and other fields useful to write a 3D world simulation.

Heck, I was heavily into math in my youth, and I still struggled a bit to come up with the code for KP ONS beams vertices.
0 x

smoth
Posts: 22300
Joined: 13 Jan 2005, 00:46

Re: How do you do ? to create space

I SUCK AT MATHS! BWA HAHA!
0 x

momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: How do you do ? to create space

Clearly competence at maths doesn't mean you know how to program. and vice versa.. duh

another method of defining space with a 3D array (ala minecraft):
http://en.wikipedia.org/wiki/Voxels

I believe spring uses a 2D array to define the space units occupy on the ground (am I wrong?). This makes it much faster to check if a square is occupied than comparing to every other unit's position (pathfinding needs to do this A LOT).
0 x

zwzsg
Kernel Panic Co-Developer
Posts: 7019
Joined: 16 Nov 2004, 13:08

Re: How do you do ? to create space

In general, maybe, though math skills and coding skills are often correlated.

However, here it's not any programming, but 3D engine programming. So it helps to know about the math used to manipulate coordinates in a 3D space. Though hopefully libraries takes care of the most of it.
Similar to how if you were coding a black jack game, it would help to know the rule of black jack.

Voxels is another mean to "paint" the 3D space, using little blocks instead of textured polygons. But the space coordinates are the same.

And yes Spring also uses several 2D arrays, for heightmap, metalmap, pathing map, tile map, etc...
0 x

momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: How do you do ? to create space

zwzsg wrote:Voxels is another mean to "paint" the 3D space, using little blocks instead of textured polygons. But the space coordinates are the same.
Precisely. I believe this is *exactly* what the OP was asking. Clearly he understands cartesian coordinates.
0 x

AF
AI Developer
Posts: 20671
Joined: 14 Sep 2004, 11:32

Re: How do you do ? to create space

www.stackoverflow.com

Great place for asking questions, complete with effective means of preventing the person asking the question and the people answering from trolling.
0 x

KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: How do you do ? to create space

You need logical thinking to work with code like that. If you want a notion of what X,Y and Z mean: They translate to pixels on your monitor. It's easier in 2D where 1 unit along the X and Y coordinates is equal to one pixel. In 3D it's completely up to the transformation matrices you use so you have to pick a scale yourself. Quake engines use inches as their units, some others use meters and Spring has "Elmos" that mean about fuck all except that they're exchanged 1:16 to footprints. You have to define a scale that you want to use. If it's your own code then try using something that your 3D applications are comfortable with (e.g. Blender prefers scales where 1.0 is pretty large, going for an inch scale there would hit trouble with the far clipping plane of the camera but 3D Studio MAX sees it completely differently). For Spring you should consider what your gameplay scale is going to be and how much of a resource hog an appropriately sized map is. E.g. for Air Raid I used 10 meters to a unit as my scale since planes operate in very large areas.
0 x

Myrias
Posts: 9
Joined: 05 Nov 2011, 08:43

Re: How do you do ? to create space

zwzsg wrote:I would guess that Myrias is too young or too dumb to have had the math courses we all take for granted around here.
you guys are so nice... (ironic)

i am 23 and i should't be a lab geek in magnetic field containment, if i was so "dumb".

obviously here the problems are not my maths, even not my code understanding but my english skill.

but don't care about me i will spend my free time in an other community.

ps: your map damage is s*** learn about physics law, it don't even look like real blow.
0 x

smoth
Posts: 22300
Joined: 13 Jan 2005, 00:46

Re: How do you do ? to create space

Programming is about abstraction, the simulation gets simplified based on how much cpu we want to allocate to something. Many times games take shortcuts to save cpu usage over realism. Odds are though, the deformation code was just a "good enough" and not this sort of optimization.

for a 23 year old your maturity leaves much to be desired, language barrier or not you should be intelligent enough to tell Z is not responsible for the deformation code. So you are insulting someone you have never met. Very rude.

p.s. for a nerd, I don't expect you know much about blow jobs unless that is how you got your magnetism job. <-trolling.
0 x

momfreeek
Posts: 625
Joined: 29 Apr 2008, 16:50

Re: How do you do ? to create space

nice guy comes in asking question. nice guy is insulted. nice guy insults back. smoth now believes nice guy is an arsehole thus his own bitterness is justified.

would be funny if it weren't so sad

there are communities where he won't be treated like shit. good luck to him elsewhere
0 x

smoth
Posts: 22300
Joined: 13 Jan 2005, 00:46

Re: How do you do ? to create space

I think you are too defensive of "nice guy".. IMO