« first day (1063 days earlier)      last day (3947 days later) » 

12:08 AM
@Byte56 do you have any tips on how to texture a mountain realistically current im just painting a rock texture on it and it looks... well... average
 
@Dave you want 3 zones. grass/dirt/trees on the bottom, rock in the middle, and snow on top. and if you have a whole range of mountains, even if they're different heights, put the lines between zones at roughly the same location.
if the mountain isn't supposed to be high enough, you can scrap the snow
 
for trees i think ill try a particle system with weight paint i ain't got that far yet :P
i often see mountains with trees rather than dirt
but i understand what you mean by using transitional textures
 
12:31 AM
I'm not really a great artist, but I would try putting some more textured, darker areas in the crevasses. And more transitional stuff around the bottom.
Like this:
 
holy hell
how the heck
 
lol well im not buying that xD
but it looks great
 
Yeah, I wasn't suggesting buying it. Just learning from it.
 
1:05 AM
1
Q: What should we use chat stars for?

Josh PetrieIn the chat, messages can be starred by clicking the little star icon to the right of each message. The tooltip for this star is "star this message as useful / interest for the transcript." Messages thus starred appear in the right panel of the chat room UI, beneath the room and user information ...

 
@JoshPetrie Aw, I was hoping you'd be able to edit before it marked it in the edit history.
 
user4704
hehe
 
user4704
oh well
 
It's the little races against time like that.
Sort day at work eh? What's that noon to 5?
 
user4704
ssssh
 
user4704
1:12 AM
still on vacation a little
 
I guess it's a slow week for work in software.
Happens all the time when there's a holiday not adjacent to a weekend.
People just take the whole week off.
At least I assume game developers do the same.
Though I guess you have different deadlines as an MMO. Holiday events and whatnot.
 
user4704
we have the 4th off
 
user4704
so yeah. light week
 
1:49 AM
Woo got chat to work.
 
Got the 4th and they set the 5th as a holiday. Planned to use the 4 day weekend to get more gameplay stuff done. But we've got like, two music videos to film in the time :\
 
user4704
I'll probably take the 5th off too.
 
user4704
Which means I had a 1.5 day work week ;)
 
Byte you in here?
 
... it took a lot of mental effort to not just post "short answer: no" in response to the "Can I become a Game Designer?" question. i'm practicing keeping my inner jerk at bay, but man, it's hard.
 
user4704
2:04 AM
lol
 
@JoshPetrie: how're things at work going?
 
user4704
I dunno, I was on vacation. Just got back today, and only got through half my email backlog.
 
aah. fun. everyone's doing holidays right now it seems
like it's summer or something
there ever been discussion about how to get more professionals contributing to GDSE, either with answers or questions?
 
user4704
It was a topic in the election.
 
user4704
2:19 AM
My current pet theory is that it's better to try and engage them in chat first.
 
user4704
Since it's more forgiving of general, subjective, possibly hand-wavy discussions
 
user4704
Which are easier for a professional to give without worrying about compromising his or her professional responsibility to an employer.
 
so it was; already managed to forget that election just happened :)
 
user4704
Thus, my recent campaign against dumb stars meta.gamedev.stackexchange.com/questions/1222/…
 
fair enough. what, you don't think "(╯°□°)╯︵ slɐɯɹou" is a useful starred comment that has enriched the fabric of our recorded chat history?
 
user4704
2:22 AM
:P
 
@ChristianFrantz yes
 
Alright. Lets figure some of this out so I can stop asking questions lol
 
@SeanMiddleditch Flipping the normals is an important debugging step
 
... sigh.
 
:p
@ChristianFrantz OK
 
2:30 AM
I think the methods I use to create each side of the cube can be useful, if I can figure out how to tell which side needs to be drawn
By using the isSolidAt method you've described
 
@Byte56: I always read that kirby icon as a different four-letter 'f' word, but my eyes have now been opened to the possibility of more literal interpretations :)
 
@ChristianFrantz I agree. But you'll need to change the way you're storing things.
 
What do you mean by that?
I use a list to store all the indices that have to be drawn and then use ToArray()
 
How do you first determine which faces need to be drawn?
 
I dont. That's what I'm having trouble with. Each cube is drawn with six faces so that creates a lot of wasted memory
 
2:36 AM
OK, how do you know where to draw a cube with six faces?
 
ah, the most popular form of culling: "cull it only if it doesn't exist"
 
I have a 2d array (map) which is just 50x50 zeroes
It just creates a flat plane of cubes
 
OK, so it's not 3D?
 
And the Vector3 position from the map is stored in the cubePosition variable which is in my cube constructor
Not technically.
Hold on
{0, 1, 2, 0, 0} Pretend that 50 rows and 50 columns. The higher the number, the higher the cube stacks
 
2:43 AM
OK, you have a height map.
 
Pretty much. The y value is the height of the cube. x and z are both equal to 50 in this instance
I'm not creating any empty cubes, which I'll eventually need when I get to the point where I have the player start "building" cubes
 
So, a is solid would look like:

isSolidAt(x,y,z)
return (cubes[x][z] <= y)
Well, if you want the player to be able to build cubes, you're likely going to want something a little more complex than a height map.
 
And that determines if a whole cube is solid right?
 
Yes
 
Yeah I will eventually. I thought about putting the heightmap into a 3d array and filling the empty spaces with "empty" cubes
 
2:47 AM
A face is added when one cube is not solid and the one next to it is.
 
Other than manually creating 200 3d arrays, I dont know how else to do it
 
200 1D arrays you mean.
Well, more than 200.
 
How would I do that with 1D?
Well if the full map is 1000x1000 there would be 200 50x50 chunks to load
 
Instead of a value being the number of cubes high, it would be a 1D array defining which cubes exist in that column.
Basically a 3D array.
Also, you don't have to create anything manually.
You should look at the source of existing games like this. Techcraft for example.
 
Wow I hate using my neighbors wifi...anyways
 
3:00 AM
Heh. Dang neighbors and their unreliable wifi.
 
I've looked at every line in techcraft. I don't really find anything that I could use in my game tho
 
Hmmm. OK. Not even how they're storing and chunking cubes?
 
@ChristianFrantz: go next door and demand a refund for this month's service fees :)
 
@SeanMiddleditch I would if I knew which apartment it was coming from!!
@Byte56 Not so much. I figured that using my map and my way of storing chunks would work
 
But you see you're kind of running into the limitations of that decision right?
 
3:04 AM
Yeah. Obviously I can't keep using my 2D array if I want the player to be able to build eventually. Unless I could use a for loop to fill the empty spaces with empty cubes
The max height would be 50, so if a cube had a height of 5 I could just use for{int i = 0; i > cubeHeight, i++}
 
A for loop isn't going to know where the empty spaces are without an array
 
and use that to fill the rest with cubes
 
Well, if you don't care about having overhangs or caves, then you can use your approach.
 
There will be no overhangs or caves in this specific map. It's a valley surrounded by mountains
Actually for this type of gameplay, caves wouldn't even work
 
OK, and you're not planning on letting the player dig into the landscape or add cubes except on top of other cubes?
 
3:08 AM
Right. The players can only use stone type cubes to build and any type of destruction to the map is caused by attacks or explosions from the player
Which should be easy. Creating a bounding sphere at the center of the explosion and delete any cube within the sphere
 
That could easily cause overhangs.
 
If they dig into the mountain, then yes. But wouldn't the cubes above just keep their position?
 
No
 
Why is that? If the player destroys a cube and replaces it with an empty cube it should stay in place I would think
 
They don't have a position, they're only defined by a number of how many cubes high that column is.
 
3:11 AM
Their position is defined from the map. cubes.Add(new Vector3(x, map[x,z] - y, z)
All the cubes have a position. If they didnt, they wouldnt be able to draw with Matrix translate = translate(cubePosition)
 
You have a height map and a large list of cube positions?
 
Yeah. Well the positions are stored in the Vector3 cubePosition which every cube has because its part of the cube constructor
 
Hmm, I really think you should reconsider your data structures.
A 3D array of cubes would solve your problems.
And reduce your memory usage.
 
It would, but keep in mind that I have 200 seperate arrays that I'm defining to create my map. Thats 10,000 individual values that I have to change to get my map to look the way I want it to
Well 10,000 for a 2d array that is
 
user4704
Bulk refactoring to transition from one code style to another is not fun.
 
3:18 AM
You're manually editing the values to make your map?
 
user4704
@ChristianFrantz Data drive that shit, yo.
 
Wurd
 
Yeah. I have no other way to do it that I know of lol
It's not like I can take a picture of a drawing and use that
And the map won't be random
 
user4704
load it from a text file at the least.
 
Better yet.
If you have 10k values
 
3:21 AM
In game editor
 
Build a tool.
 
That was actually my first plan. But I quickly realized I didn't know anything about loading files
And I don't know anything about building a map editor either lol
 
Your wrists will thank you later.
 
Vaughan, you creepin' on chat?
 
That should be your number one mantra for everything you do: build a tool.
 
3:21 AM
Serialization can make it painless.
 
user4704
@ChristianFrantz Learn.
 
I'm always around.. in the shadows.
 
From where? That requires a UI
And it doesn't change the fact that I dont know how to cull faces haha
 
@ChristianFrantz: Wait, you don't know how to load a file but you can render 3D scenes? Holy Inverted Order of Operations, Batman. :)
 
user4704
@ChristianFrantz No it doesn't.
 
3:22 AM
Worry about optimization later.
 
If he's building a voxel engine, I disagree.
Optimize NOW.
Those things blow.
 
Well, plan for optimization now :)
 
I drew my cubes naively when I did one
 
@SeanMiddleditch Yeah this is my first time trying to create an actual game. I've read like 3 books on XNA 2d and a couple for 3d
 
I got like.. 12FPS
 
3:23 AM
I get 7 when I draw 4 grids of 50x50
 
Yeah, you have to be smart about voxel engines. Optimize first, you'll regret it otherwise.
 
I suppose you can optimize a little then.
 
That shit gets slow, fast.
 
I built mine in such a way it was pretty painless to optimize, but I can see it being bad.
 
@VaughanHilts: we're not saying "don't optimize," just put things in order of priority - you can't even reasonably test many optimizations if you can't quickly build scenes that trigger the right cases
 
3:25 AM
@SeanMiddleditch I agree - but it seems like his experience is.. inverted. He might be scared off if the immediate problem takes 5 years to solve.
 
My goal is to get a few chunks of the map loaded with a good fps before I do anything else to the game
 
@SeanMiddleditch In this case, I'd solve the immediate problem and backtrack. Ideally, you'd learn all the file IO goodness first, but.. :)
 
Lol I dont think this will take 5 years to solve. But its been frusterating so far :P
 
@VaughanHilts: fair enough
 
If I can get face culling to work right, I'll have made a lot of progress
And when the time comes that I want to draw a full map, I'll look into building a tool
 
3:29 AM
Well, I'm off to watch Hunter x Hunter. See all of you later. :)
 
Later
Anyone have experience with Unity particle systems?
 
@ChristianFrantz: are you sure face culling is even the problem? have you measured GPU load vs CPU load? when I see code samples that are calling new to allocate position vectors for every cube, I start to worry.
 
Why is that a problem if they're on the stack vs. heap?
And once?
 
I have not. But I use an int to measure my draw calls and I'm pretty sure 100,000+ is a bad sign
 
Yeah, that is
4,000 should be around your max for comfort
 
3:32 AM
I have a method in my cube class that draws the cube, and then a draw method in my main game class that applies the translate matrix to each cube in my cube list
 
@VaughanHilts: nothing to do with the stack. you can allocate contiguous chunks of memory on the heap rather than individually allocate everything
 
So theres a lot going on
 
In C#?
 
Link?
 
3:32 AM
struct keyword
 
Well
The vectors are structs..
 
the vector3 might be a struct, so moot point
 
lol
That's what I was getting at
 
thought maybe this was java we were talking about, the "xna" bit should've given it away though :) still, the position should also be implicit to the data structure
 
:) To my knowledge, every struct in C# is on the stack, and has pretty much no overhead being creatd
created*
 
3:34 AM
local variable structs are on the stack
structs in a List<> are obviously not on the stack
 
Well, no.
 
but they should be in a contiguous chunk of memory rather than individually allocated, so yeah, all's good
 
Byte told me to use a struct to create my cube, but how is that different from using a class in c#?
 
Classes just have higher overhead
If you only make them once, though it won't affect performance.
(Provided they're stored together)
 
But if I have 2500 cubes, thats 2500 instances of that class
or object in that class rather
 
3:36 AM
That's not unheard of
 
a class is individually allocated by itself. a struct is not. so a class could be located anywhere in ram that C# wants to put it, while an array of structs will be tightly packed together. accessing ram is not cheap; it can actually be one of the slowest things on modern CPUs. keeping all your data tightly packed can help a lot with performance
 
The overhead is minimal - it's a matter of what you're doing with those 2500 objects
 
I didn't say use a struct to create your cube
 
Hmm well someone said it in one of my questions lol
 
I did mention data structures, is that what you're thinking?
 
3:37 AM
A struct is not a good choice for the cube data type
 
Those are different things.
 
Struct is misisng a lot of good functionality that you could use
 
Maybe. But I think my problem is with my amount of draw calls that I have
 
Have you ran a profiler against it?
 
3:37 AM
so what part of face culling are you stuck on?
 
I only really need a cube position, and an int or something to store the type
 
That'll tell ya
 
Well if I'm getting over 100,000 calls then the problem lies there lol
 
@ChristianFrantz: if you use a proper data structure like Byte56 suggested, you won't need the position, either. it'll be implicit in the data structure. that's an optimization you really want eventually
 
@SeanMiddleditch I've looked over the pseudocode Byte gave as an answer in one of the questions, and logically it makes sense to me. I just don't know how to compare two sides of a cube to each other, and not draw them if there are indeed two adjacent sides
 
3:39 AM
Well
You need their individual positions still.
 
If I can get the face culling to lower my amount of draw calls, I'll be happy
 
If that's the case, why noit read one of the hundres of papers on culling?
 
Each chunk of cubes is put into an index and vertex buffer also
Lol I have seen a lot on culling, I just have trouble implementing the logic into my code
Should I be using DrawIndexedPrimitives for this? I've read that its faster than some of the other draw methods
 
this goes back to data structures. the result is easy. if you have a cube A, check the position directly above it. if there is no cube there, then the top of A is visible, otherwise it is not. stuff that top face into a list of vertices (pre-translated). repeat for the other 5 sides
 
Yup.
Draw a diagram.
Of all the combonations.
Then translate those combos to code. Profit??
Hey, this is always something that drove me nuts.
Is there an elegant way to avoid out of bounds in those situations?
 
3:43 AM
@SeanMiddleditch So (x - 1, y, z) in the pseudocode is what youre describing?
 
This is the answer you should use: gamedev.stackexchange.com/questions/28522/…
 
i.e: doing (x-1, z, z)
And findind out x - 1 is -1
 
I'm pretty much basing everything I'm going to be coding off the answer in that question.
 
@ChristianFrantz: sure. that is the position of the cube to the "left", so use that to test if the cube's left face is visible or not. repeat for x+1, y+/-1, and z+/-1
 
But to test if the cubes side is visible, you need the method Byte described earlier and return a bool isSolidAt(x - 1, y, z)
?
 
3:46 AM
You use the bool to determine what to add
So for example, in the case of the top face one
You do isSolid @ top
If it is, don't add a top face for THAT cub
 
@ChristianFrantz: yes. you need a way to test if a cube is at or not at any particular position. hence the desire to use a good data structure
 
if(isSolid(x, y + 1, z)
addTopFace()
So
 
!isSolid
 
Oops.
lol
I said it right in text
Missed the ! in code ;(
 
paired programming win! :p
 
3:47 AM
@SeanMiddleditch Would I be better off using a different data structure before I go any further in this?
 
If you plan on surviving in the long run.
 
As long as I can render the full map, I dont care if I survive lol
 
@ChristianFrantz: I don't know that you need it now, but you need it eventually. if you can't efficiently implement isSolidAt then yes, you need it now
 
Then no, you don't need it.
As long as you don't need to
Iterate of every block to find it
 
How would I change what I already have? I've rewritten my cube class like three times lol
 
3:49 AM
i.e: my entity component system before I used a hash map
Can I see your code?
Before I go watch TV rq
 
If you go to my profile and view some of my questions, you can piece together my whole cube class. Im pretty sure the whole class is actually pasted in one of them
I'm on my laptop so I can't grab it from my other computer unfortunately
 
@ChristianFrantz: to start, you wouldn't have a Cube class. you'd most likely just have a 3D array of ints. You don't need a position for each Cube because the index of the cube is its position
 
2
Q: How can I determine if a cube is adjacent to another cube, and optimize its buffers if so?

Christian FrantzI'm trying to optimize the rendering of a collection of cubes, (based on an answer I was given to another question I asked). I understand the logic behind occlusion culling, but I'm having trouble with the code. When I create a cube, I want to determine if that cube is touching another existing ...

Andrew kindly already wrote all the code for you.
 
And this would mean just building the faces around the indexed position?
 
If you have a 3D array, 0, 0, 0 is at position
(0, 0, 0) * CubeSize
You can literally just multiply the index positions by your cube size
 
3:52 AM
@VaughanHilts Yes he did. I just didn't know how to add faces at that point
I completely forgot about that answer lol
 
That's exactly what you want and what we've been saying
AddFace would simply.. add the face
 
Yeah and I understand it now lol
I have methods for that as of today
 
I'll give it a shot and report back in a few minutes
 
@SeanMiddleditch I'm curious now - are objects in lists / hash maps kept together in memory?
 
3:56 AM
are you clear on what addFace does? you said your Cube class draws itself; better to just add faces into a single list of faces/vertices and then draw them all in a single draw call. down from 100,000+ to 1.
@VaughanHilts: not if they're classes. how would it do that if you allocate an object and then put it into the array? with a struct, it's copied into place, so contiguity can be maintained
 
The addFace method has become my SetUpRightFaceIndices method, which just adds the indices for that face to my indicesToDraw list
 
Hm.. never really thought of that.
I've never really run into issues with classes being too sporadic to cause issues.
I guess it plays a role in games that need the heavy optimization.
 
@ChristianFrantz: you can't just add indices, you need individual vertices. that means you need to take the untransformed face, add the current cube's position, and then stuff those into the list. you can still share indices but that's a bit harder to do. i'd avoid index buffers for now
@VaughanHilts: even for apps that only need moderate optimization, iterating over non-contiguous objects is killer on the CPU cache
 
Hehe.. well I guess shoving a list of entities in a giant list and iterating over them is a bad idea. :)
 
I think I want to go back and get another degree someday, I wish my undergrad was a math major.
 
3:59 AM
But thye need to be classes, so what choice do I have :)
 
Ah yikes. I forgot about the vertices.
 

« first day (1063 days earlier)      last day (3947 days later) »