Reputation
647
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 8
Newest
 Yearling
Impact
~12k people reached

Jun
23
comment Algorithm for dividing a 2D grid into organic looking plates
Awesome, good for you!
Jun
3
comment Cram search results into viewport (of a search minimap)?
@helena4 I didn't mean to be picky, but rather trying to identify the best community to give a useful answer to your question.
Jun
2
comment Cram search results into viewport (of a search minimap)?
This doesn't seem to be gamedev specific -- perhaps try SO or ux.SE?
May
28
comment Algorithm for dividing a 2D grid into organic looking plates
@ChristianGeese Would you feel comfortable posting your code to a place like pastebin or something like that? I'd be happy to have a look -- I don't know C#, but maybe I'm able to spot something that might cause the slowness anyway?
May
28
comment Algorithm for dividing a 2D grid into organic looking plates
@ChristianGeese Even if you use Cell and Plate classes (instead of ints), the code should run very fast, as long as you used the same algorithmic approach.
May
20
comment Algorithm for dividing a 2D grid into organic looking plates
I've now updated the code slightly: the bit masks are gone and with them is the restriction of a maximum of 32 colors. The bit masks were used to store for each unfilled cell which are the candidate plates it could be assigned to. The new version simply looks that information up in the actual grid. Secondly, I added the border wrap-around. It turned out that both changes actually simplified the code somewhat. Last but not least, I changed some variable names for better readability. Enjoy!
May
19
comment Algorithm for dividing a 2D grid into organic looking plates
Storing the cells with adjacent plates might be useful if, e.g., you want to guarantee that the plates are (more or less) the same size.
May
19
comment Algorithm for dividing a 2D grid into organic looking plates
@ChristianGeese - Filled cells should never be overwritten: the cells array contains a list of all unwritten cells and a cell is removed from that list as soon as it is assigned a plate. This way it can never be overwritten. But now I'm curious: you say you already implemented it this way, yet a 500x500 grid with 6 plates take "forever" -- the above code, however, can fill 500x500 with 10 plates in under a second on my machine?!
May
19
comment Algorithm for dividing a 2D grid into organic looking plates
Well, you beat me to it ;-) But apart from that, I think it's useful in that there's some sample code to look at.
Feb
6
comment how to detect collision with libgdx and tiledmap
How are your tiles represented internally? That is, how do you know where on your grid you have to draw grass, where to draw a tree, where to draw a wall, etc.?
Aug
21
comment Transparent JPanel, Canvas background in JFrame
What's the purpose of that JPanel?
Aug
19
comment Why does my code dividing a 2D array into chunks fail?
Ah, ok, so you want the chunks for loading, not for collision detection.
Aug
19
comment Why does my code dividing a 2D array into chunks fail?
Are you sure you have to create a chunkArray at all? If it's just for collision detection, couldn't you still work on the original world array, but instead of checking all of it, limit the checks to a certain area of interets?
Jun
30
comment which quarter of a triangle the point is in
@MSalters Thank you, very good observation! By the way, I didn't mean to suggest matrices as the way to implement this, it's just to demonstrate the steps.
Apr
10
comment Can you adjust the proportions of a 3D model via scripting?
I think Esa's answer nails it (even without a code example).
Apr
10
comment Game loop in Javascript
Reading other people's source code can be an excellent way to learn things.
Apr
10
comment Can you adjust the proportions of a 3D model via scripting?
It's doable, but the result might not look very good. Also, I wonder if in addition to the body proportions you would also have to adjust the animations anyway to account for the different ages. So in the end, my gut feeling is that you won't safe much time doing a parameterized model over drawing the different ages separately, but the quality might be much worse.
Apr
9
comment Is any data structure more efficient than quad-tree for storing and querying points that lay within an OBB?
Yes, that's why I thought this datastructure might be (more) suitable for your situation. Glad I could help.
Apr
8
comment Is any data structure more efficient than quad-tree for storing and querying points that lay within an OBB?
What you probably want is to walk up and down the tree to determine areas that are close by.
Apr
1
comment Calculate turn rate between xy and target xy on a moving sprite with variable speed
Cool! Glad to hear you got it working. In retrospect, I think if I were to implement this, I would now prefer my second answer over this one.