« first day (1669 days earlier)      last day (3341 days later) » 

12:06 AM
so...it has come to this
 
12:33 AM
I'm off to bed, we'll fart again tomorrow
 
@Wardy Looks good, but yeah, you definitely need to work on the colors :P
 
im experimenting with it now ... im not far off
i'll post another comparison in a bit
 
I'll have to head to bed. Be sure to ping me when you do post it. ttyl
 
ok dude
later
 
 
1 hour later…
2:27 AM
@William'MindWorX'Mariager Well i'm still not happy with it but its a ton closer than it was
slap an atmosphere around it and its good enough to move in I spose :)
I really need to get back to the size problem next
this planet just aint big enough!
lol
@Ali.S @Pip Figured I would just ping you guys ... you seemed to like the last pics I posted these are only going to get better!
@Lasse these planets are part of my scaleable voxel architecture ... the end game being that you can land on them and then play minecraft if that's the sort of game you're building or not if you just want a subset of that.
A decent engine with hardcore threading would make this code really awesome!
right im off to bed ... slap together some LOD architecture tomorrow I spose ... its either octrees or something custom ... not decided yet.
 
 
3 hours later…
5:15 AM
user image
7
 
5:25 AM
@Wardy How close is that moon thingy? It looks a bit close.
 
5:46 AM
Pretty sure its just a comparison of his planet vs earth to show scale
At least that's my guess.
 
 
2 hours later…
Joe
7:23 AM
I ALWAYS had a sneaking suspicion of this
 
Joe
random ladies be all like... oh come in for some "heals".. never a dude
 
I don't see how that would possibly mean anything else
 
Joe
haha
 
That's clearly a brothel
A healer would have the red + on it
 
Joe
7:28 AM
very true
 
it's obviously a nurse
 
Joe
i should load this up... see if my rupee count diminishes upon receiving "help", lol
 
user92578
7:50 AM
@toby Yeah, I'm using C++ and SLD2
 
user92578
@AttackingHobo true, and I already made it a lot smaller
 
user92578
morning guys!
 
user92578
@AttackingHobo looks interesting
 
9:05 AM
@Wardy I have been also building a whole platform to remake minecraft mechanics and fix some of the issues it has when it comes to modding, but that project is on pause at the moment
but yeah, that looks cool :)
different planets were also part of my plan, seems like it really can be implemented
 
user92578
turns out sdl's collision detection method is slowing me down quite a lot
 
user92578
oh wait no it isnt
 
SDL has collision detection?
 
user92578
yeah
 
I thought it was only a graphics libraray
 
user92578
9:12 AM
it's a multimedia library
 
user92578
it has a lot of things
 
yeah right that was the word I was looking for
what's the api for collision detection?
 
user92578
	if (SDL_IntersectRect(boundingBox->GetRect(), GetRect(), m_NullRect) == SDL_TRUE)
	{
		return true;
	}
	return false;
 
user92578
m_NullRect is a rect where the intersection amount is placed
 
user92578
but I don't care about it
 
9:14 AM
okay
resharper (code quality plugin) would whine about that
return SDL_IntersectRect(boundingBox->GetRect(), GetRect(), m_NullRect) == SDL_TRUE;
that would do the same thing
 
user92578
thanks :D
 
user92578
that is some of the first code I wrote when I started working in C++
 
user92578
so a 9x8 grid of dynamic boxes slows the game down a bit
 
user92578
that aint good
 
user92578
maybe I need to place those in the quadtree too...
 
user92578
9:17 AM
it's just slow to update quadtree positions
 
user92578
as I need to first find the item, remove it, and the re-insert it if it's position has changed
 
user92578
I guess I should've seen this coming as I had so much fun adding features yesterday, this day has to be a performance improvement day
 
there are always those days
 
user92578
9:37 AM
Hmm, didn't see this one happening:
 
user92578
 
@Wardy That looks super sexy. :D
 
user92578
rounding seems to be quite slow
 
user92578
when done many times
 
That sounds unlikely.
 
user92578
9:39 AM
SDL_Rect* CBoundingBox::GetRect() const
{
	SDL_ModifyRect(m_Rect, roundf(X), roundf(Y), roundf(W), roundf(H));
	return m_Rect;
}
 
user92578
This is one of the slowdown places
 
I've rounded around ~400k times a second without a hitch. :P
 
user92578
The method itself uses 19.96% of total cpu
 
user92578
SDL_ModifyRect takes 3.04%
 
user92578
and "External Code" (probably rounding) takes 12.03%
 
9:41 AM
Move the rounding into separate lines, and see if that is true. :)
Also, is that 19.96% of a time slice? Cause that doesn't mean it's slow. It just means you spend more time doing that than everything else.
Which makes sense if you round 4 times for every entity for every frame.
 
user92578
now the precentages are smaller, modifyrect takes 1.62% and external code takes 6.7%
 
user92578
the whole method 11.81%
 
user92578
maybe it's something about copying values when they are passed as parameters?
 
@AidanMueller thats deliberate so i can test the matching I was doing (the bigger of the two is earth the smaller is my planet, the idea being that they are both to approximate scale)
@Lasse These planets only need a seed, they are noise based: i'm using a customisable noise module stack. One of the things I really need to get working is my noise toolkit in either unity or VS (its a node based editor)
 
user92578
It's always that one method that slows everything down
 
9:47 AM
@William'MindWorX'Mariager I know right :) It's still quite all there, and I'm in the process of looking space partitioning / LOD systems to handle the orbit to ground transitions
 
@Tyyppi_77 I'm still curious how exactly you're measuring.
 
user92578
I'm using the VS profiler
 
@Tyyppi_77 is this that circle thing ?
 
user92578
?
 
Hmmm maybe it was someone else
You working with pygame?
 
user92578
9:51 AM
no
 
ok my bad ... crossed wires
If you have a strongly typed language a "cheap round" might be to simply cast the value to an int
 
Alright, consider this. Your program spends 0.4µs on everything else and 0.1µs on GetRect(). Does this mean that GetRect() is slow?
 
user92578
okay 50% of the total CPU usage of my game is taken by the collision checking method
 
It comes down to 20% for GetRect().
 
its not quite the same but it would save time
 
user92578
9:52 AM
 
1 min ago, by William 'MindWorX' Mariager
Alright, consider this. Your program spends 0.4µs on everything else and 0.1µs on GetRect(). Does this mean that GetRect() is slow?
The answer is no. It's still only a total of 0.5µs. It just means you added some code that is run often.
 
user92578
well true
 
user92578
okay so how would I figure out what "actually" takes a lot of time
 
Well, if you're actually experiencing lagging, you could use this.
But it's running at 20% CPU the whole time, so I doubt it's lagging.
 
How many times you calling that check entity collision method per frame?
 
user92578
9:57 AM
the amount of dynamic entities times two (one for the x axis and one for y)
 
why ?
not all entities can move
 
user92578
dynamic
 
surely you could handle that as part of updating an entity?
 
user92578
I have separated static entities and dynamic entities
 
when an entity is updated check for collisions
 
user92578
9:58 AM
Yeah, that's what I'm doing
 
but only between that and nearby entities
 
user92578
that's the problem, as I don't store the dynamic entities in a quadtree where I could query them
 
you probably want to use an oclusion map then
so say you have a player entity and then your "world" you can draw a texture that shows where the player can move to, then its just a lookup on a set of pixels
saves you having to query all your entities
could be as simple as a big array of booleans or something
 
user92578
like currently I can get the static collision boxes from a quadtree
 
user92578
but the problem is when I have a lot of dynamic entities that I can't just query from a quadtree
 
user92578
10:04 AM
so currently I need to loop over 116x2 boxes per entity per frame
 
collision boxes yes ... the idea behind an occlusion map is that all the collision boxes can looked up in 1 hit by querying just the map
 
user92578
I could also try putting the dynamic entities into the quadtree
 
say you had a texture for your occlusion map ... all the places where you dude could move could be white and all the places he cant could be black, then you could simply ask "are any ofthe pixels im using to draw my dude black" if yes collision
simplifies the problem down to a single lookup on a map
116 queries just became 1
 
user92578
but then I'd have to update that texture
 
user92578
and figure out what is on that black pixel I couldn't move to
 
10:06 AM
depends how your world works
 
user92578
and pick the correct response based on that
 
surely you got some sort of tile info for your world ?
when you gen a new world tile add to the map
and when you remove a tile take it out the map
 
Just go with the quad tree :P
It's fast and efficient.
And just add rects on top of every tile. Your worlds aren't huge, so it shouldn't be a problem.
 
in fact i think some even use the occlusion map as their raw map data storing say an array of numbers where up to a certain value is pass able and beyond that isnt
 
You could even run some optimization if you really felt like it.
 
10:08 AM
then 1 set of data solves the collision and rendering problems
my idea works the same way @William'MindWorX'Mariager just flattens the problem down
no need for the tree basically
I don't think it would work as well in 3d
but quad trees in 2d are overkill imo
 
user92578
So my world in terms of collision is currently divided into two parts
 
they add complication where really you don't need it
 
user92578
world collision areas are drawn in tiled over the terrain tiles
 
user92578
those collision boxes are stored in a quadtree
 
user92578
then there are dynamic entities (that update every frame) that are currently just stored in a vector
 
10:11 AM
surely tiles should just be marked passable or not then their bounding boxes are the collision bounds ?
 
user92578
basicaly if my level has just a solid straight floor on the bottom, it is drawn in the level editor as just one collision box
 
right i got work to do ... looks like im implementing an octree today :(
 
user92578
My individual tiles don't have their own bounding boxes
 
having an occlusion map basically gives you that and combines them
so you get an image of where overall things can and can't be moved
 
user92578
but I pretty much have that, and I have no problem with the static level geometry
 
10:15 AM
so do you have dynamic entities that are impassible ?
is that the problem ?
 
user92578
yeah
 
hmmm ... might make sense to do like you said before then given where you are
throw your dynamic entities in to the quad tree
job done
 
user92578
the thing is that removing from an quadtree is slow
 
slow why ?
 
user92578
as I need to remove and re-insert the dynamic entities there every frame
 
user92578
10:16 AM
it's a big recursive method
 
why would you do that?
 
user92578
when the position changes, I need to find a new place for it in the quadtree
 
do they definitely move every frame ?
 
user92578
no, but very likely
 
user92578
enough to cause slowdowns if removed from the quadtree
 
10:17 AM
but if you know the node the entity was in then basically the new insert is just a parent level request ?
you shouldn't need to crawl the whole tree
 
user92578
that's actually a good point
 
then if that parent deems you outside its range it can pass up
so you only go up as far as you need to
rather than starting from the root and working down
that could be pricey
 
user92578
but entities don't know where they are in the tree
 
ok but the treenodes know what entities they have right ?
 
user92578
yup
 
10:25 AM
so maybe entities could raise an event to say "i moved"
then the node they are in could subscribe to that
it can then handle moving if need be between itself and another node
likely by doing like i said and passing the event up the tree
I have a very complex problem to solve that im making absolutely no progress on
i keep putting it off :(
I have to generate planet regions in chunks and pass to an octree
2d feels real good right now
 
user92578
:D
 
my process goes something like this ...
for(each region)
   generate new game object
   kick off threaded task to gen surface
   gen mesh for the region
   when task completes, texture mesh with results
evil math
 
user92578
Omg I'm lerping a lerp factor
 
lol - that's evil too
 
user92578
10:41 AM
"once you go lerp, you never go back"
 
user92578
10:55 AM
what's the "best" way to pass around std::vectors?
 
user92578
std::vector<CBoundingBox*> CLevel::GetCollisions(const CBoundingBox* target) const
{
	// Starts with all the dynamic bounding boxes whose locations are unknown.
	std::vector<CBoundingBox*> result = m_LevelObjectStorage->m_BoundingBoxes;

	std::vector<CBoundingBox*> quadTreeQuery = m_LevelObjectStorage->m_StaticBoundingBoxTree->GetInArea(target);
	// Adds the quadtree query results to the vector.
	result.insert(result.end(), quadTreeQuery.begin(), quadTreeQuery.end());

	return result;
}
 
user92578
This code is called a lot, and my profiler is showing that a lot of allocations are being made
 
user92578
how would I make that more effecient?
 
user92578
in terms of passing vectors around
 
either create the vector on the heap and return a smart pointer or create a vector in a broader scope and use references
 
11:00 AM
Or get a pointer to a vector in and let the calling function take care of the allocation
 
or pass a vector in a parameter
 
Reference parameter also works (pass by value doesn't I think)
 
user92578
aight I think I'll try returning a reference
 
Where will you be creating the vector then?
 
be caureful, you can't do this as is
 
11:01 AM
Cause a reference is just a pointer with fancy syntax
 
user92578
yeahyeah, I'll create a vector on the CLevel
 
good idea, in that case it may be simpler to just pass the vector in the function and let it fill it instead of returning a reference
since you already have the object that you get the reference to
actually you don't have to pass anything since the vector would be usable inside the function
 
11:25 AM
gah ... anyone know how to turn degrees in to x,y,z
don't seem to be the same as polar coordinates
 
degrees from each axis?
 
yeh ... im confusing myself
In mathematics, the polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by a distance from a fixed point and an angle from a fixed direction. The fixed point (analogous to the origin of a Cartesian system) is called the pole, and the ray from the pole in the fixed direction is the polar axis. The distance from the pole is called the radial coordinate or radius, and the angle is the angular coordinate, polar angle, or azimuth. == History == The concepts of angle and radius were already used by ancient peoples of the 1st millennium BC. The...
so I have north south east and west as angles in degrees
and I need to determine the bounds for which I am going to generate a mesh
 
this may be useful
In mathematics, a spherical coordinate system is a coordinate system for three-dimensional space where the position of a point is specified by three numbers: the radial distance of that point from a fixed origin, its polar angle measured from a fixed zenith direction, and the azimuth angle of its orthogonal projection on a reference plane that passes through the origin and is orthogonal to the zenith, measured from a fixed reference direction on that plane. The radial distance is also called the radius or radial coordinate. The polar angle may be called co-latitude, zenith angle, normal angle,...
 
11:47 AM
yeh i think that's where i got my existing implementation from
Don't think my implementation is correct though
        public static SphericalPosition FromCartesian(float x, float y, float z)
        {
            var r = (float)(Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2) + Math.Pow(z, 2)));

            return new SphericalPosition
            {
                Radius = r,
                Inclination = y > 0 ? (float)(Math.Acos(z / r)) : (float)-(Math.Acos(z / r)),
                Azimuth = x > 0 ? (float)(Math.Atan(y / x)) : (float)-(Math.Atan(y / x))
            };
        }

        public void ToCartesian(out float x, out float y, out float z){
I'm sure i missed something when testing this the numbers don't feel right
might put together some unit tests
 
isn't Math.Atan only for -pi/2 to pi/2 ?
ignore
 
I don't really understand any of those functions
lol I just know that from the details on wiki ect if I call them I get the number i need (in theory) for my calc
 
it also depends from which axis you start measuring the angles
is the FromCartesian function correct?
 
given that my point of origin (sphere center) is at 0,0,0 in cartesian space if I know an angle up and down (north south) and an angle left and right (west east) I should be able to determine a point in cartesian space
@Veritas thats the problem I don't know
 
user92578
can you do ToCartesian(FromCartesian());?
 
user92578
12:01 PM
and see if the result is the same as the input? or does it not work this way?
 
thats the idea i should be able to do something like ...
var pos = new Vector(x,y,z);
var spherical = SphercalPosition.FromCartesian(pos.x, pos.y, pos.z);
var newPos = spherical.ToCartesian();
I'm not convinced its all working right as I would expect.
 
Try Math.Atan2
 
user92578
@Wardy and newPos == pos, right?
 
it should
I'm just putting together a test app now
 
I am almost sure it's the Math.Atan but take my work with a grain of salt
check this part in wiki: The inverse tangent denoted in φ = arctan(y/x) must be suitably defined, taking into account the correct quadrant of (x,y)
basically if x < 0 you need to differentiate on y < 0 and y >= 0
you don't take into account the sign of y when calculating Azimuth so i think that's the bug
 
12:19 PM
ok something definitely aint right
rounding issues
 
hmm can you try larger x,y,z values?
ignore
 
in all cases (except 0,0,0 of course) surely the radius should come out 1
 
you forgot to divize z
with the sqrt of the squares
ignore
guys I'm off too tired
 
doh
:(
Hmmm actually i think this looks correct
if im at say 1,0,1 then im outside the sphere so the radius will be high
 
12:37 PM
that's probably it
yes this makes sense
well it's not that it's outside the sphere
the radius is of the sphere's after all, the radius of the sphere on which (1,1,0) for example lies just doesn't have to be 1
the end results also look pretty good
 
user92578
I'm getting really weird profiler results
 
user92578
on the top of the list is a function that is supposed to log stuff but no output is seen
 
user92578
Basically I have the same problem as in this
 
user92578
-5
Q: C++ Very Sleepy strange results

Mushroom15I'm currently programming an SDL Network Game, everything is perfect ... But my game only runs at 30fps, so I ran a Very Sleepy analysis. First strange effect, very sleepy increase the perfs of my Game to 60Fps ... ( Why ? ) And secondly, there is a lot of SDL_LogCritical calls ( you can get the...

 
user92578
but there's no real answer to his problem
 
12:50 PM
@Veritas its the conversion back I think that's wrong
eg: (1,-1, 0) ends up being (0.9999, -1, -6.181)
the spherical values look reasonable and within the sort of range I would expect (not sure if they are exactly correct though)
but from those it gets a way out cartesian
 
1:04 PM
it's E-8
so that's pretty close to 0
 
hmmm
so maybe i just need to apply some accuracy rounding
 
that's like 0.00000006
not really worth it imo but depends on the context
 
hmmm
 
Jon
 
1:53 PM
@Wardy it seems way too good to be real ...
 
what does ?
@Ali.S ?
 
your planet textures
 
textures are easy to make look nice ... just crank up the resolution
the hard part is tying that back to the data
 
2:13 PM
So @Wardy what was the problem?
 
I don't think there was one
I was reading it wrong
Didn't notice the -8E
I think i mostly use the values against my voxel array anyway so the float values get cast to ints
dammit i still don't have what i need though
 
user92578
2:31 PM
I'm kinda in a point where I don't know what I need to do next
 
same here
 
user92578
I think I pretty much have gameplay wise everything programmed
 
user92578
except if I wish to add something like falling floor etc.
 
user92578
So I think I'll get to programming the main menu
 
user92578
or something
 
got the map editor finished?
 
user92578
2:48 PM
I don't have a map editor
 
how do you implement game content?
 
user92578
tiled
 
That diagram might solve my spreading.
Basically, I look for the situation on the left, and then mark the lower right particle that it should move right.
Next step, I move it right if it can.
I could use the alpha channel for "desired" movement.
 
3:23 PM
0
Q: How to get a position from a radial distance and angles?

WardyI have a radius and the 2 angles for northSouth and eastWest rotations in degrees. I need a Spherical position or a cartesian position (I have code translate one to the other) Where a position is defined as one of the following ... class Vector { public float x; public float y; public f...

Meh, I have no idea where to even start with this
 
4:12 PM
Better sand spread, but it seems to have a weird stable state that I can't figure out how is happening.
 
@William'MindWorX'Mariager "a wierd stable state"?
 
Yeah, those single particle lines are stable. They're just standing there, not spreading out.
I guess I'll have to try and run through the steps by hand and see where the problem is.
It's pretty simple, which is why it confuses me.
Basically, if there is air below, it moves down. If there's air on the left and dust below, it moves left. If there's air on the right and dust below it moves right.
 
is it because you have a condition where the grain of sand above is perfectly positioned above the one below so is considered to be "supported"
 
It does this in random order.
 
you probably want some sort of diagonal check or something
oh i c
hmmm
 
Pip
4:18 PM
@Wardy looks good
:D
 
they are awfully close together ... is there some sort of edge case / race condition occurring where the column between 2 stacks is considered populated
@Pip I know right :)
just trying to figure out how to get the points to apply my mesh generator
 
It's possible that it just moves right, and then immediately left again before the dust above falls.
 
can't get my head round that at all
@William'MindWorX'Mariager that sounds plausible
@William'MindWorX'Mariager maybe cellular automata could help here
you'd have to sequentially process though
 
4:25 PM
Yeah, that's not good for GPU :)
 
or do some sort of pattern based processing
 
That's what I did before :)
But that resulted in pyramid stacking :P
Not really good looking.
 
how does water simulation usually work on the gpu ?
don't they do it over many frames
 
I'm not sure.
I wonder ...
Could it be that it can't pick out the individual pixels properly?
Nah, then I shouldn't be able to render it properly either.
Hmh
 
hmmm i think (it's been a while so don't quote me on this) but from when I last looked the usual trick was to render a frame in the initial state then apply changes to half the data then on the following frame apply to the other half
that'sa really old school way of doing it though
has to be a smarter way
particle coupling perhaps ?
 
4:34 PM
Hm
Well, what I'm doing now should work. I just have to figure out why it does the weird stacking.
 
is that what you're trying to achieve?
 
no idea how thats done
cool though
 

« first day (1669 days earlier)      last day (3341 days later) »