Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411491 Posts in 69377 Topics- by 58433 Members - Latest Member: graysonsolis

April 29, 2024, 08:46:40 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 87 88 [89] 90 91 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 739016 times)
increpare
Guest
« Reply #1760 on: February 25, 2011, 12:25:59 PM »

Flash sharedobjects shouldn't be called sharedobjects, they should be called jealouslyguardedobjects.  Fuck them.
Logged
oahda
Level 10
*****



View Profile
« Reply #1761 on: February 26, 2011, 05:10:31 AM »

Huh.  I just created a pointer that needs to point to it's parent.  And that parent contains the pointer. Crazy

Box2D is funny sometimes. 
This has never happened to me when using Box2D. What were you doing, and what caused this?
Logged

increpare
Guest
« Reply #1762 on: February 26, 2011, 07:42:15 AM »

in the flash builder interface editor, the only way to reparent some objects (or, well, faster by a factor of 100) is to go into xml mode and copy-paste.  (If you have a panel that you want to reparent, and it's filled with things, you can't drag it anywhere - as soon as you click on it it selects whatever you have your mouse over).
Logged
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #1763 on: February 26, 2011, 08:27:15 AM »

Huh.  I just created a pointer that needs to point to it's parent.  And that parent contains the pointer. Crazy

Box2D is funny sometimes. 
This has never happened to me when using Box2D. What were you doing, and what caused this?

He's probably done something like:
Code:
class MyWorld : public b2World
{
  MyListener listener;
}

MyWorld::MyWorld():
  b2World(),
  listener(this)
{
  SetListener(&listener);
}
It's not so bad (pointers are cheap), but there's plenty of ways to avoid that. You can use multiple inheritance or pointers to members.
Logged
Aquin
Level 10
*****


Aquin is over here.


View Profile WWW
« Reply #1764 on: February 26, 2011, 09:30:00 AM »

That's exactly the situation Boris, and that's precisely how I solved it yesterday.  I didn't feel comfortable with the whole 'pointer to parent' thing.  It doesn't bother me so much (I mean it does actually work in practice), but yeah conceptually it was wigging me out.  I felt like my compy was bad-touching me.   

As for your adaptation of Box2D, you have done a fine job sir!  I quite enjoy using it!  Gentleman
Logged

I'd write a devlog about my current game, but I'm too busy making it.
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #1765 on: February 26, 2011, 10:52:20 PM »



Why would it do that thing it's doing, with the diagonal eyes?

EDIT: The texture glitch seems to happen right at the division between the two triangles I use when creating that quad. Darn it.
« Last Edit: February 26, 2011, 11:02:45 PM by mcc » Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #1766 on: February 26, 2011, 11:43:51 PM »

If I could switch to quads, I could get rid of the triangle seam and maybe fix this last problem.

But quads won't draw for me anymore.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Sakar
Guest
« Reply #1767 on: February 27, 2011, 01:23:31 AM »

I can't for the life of me get this water spreading to work. It should be a simple "is overlapping at offset" check, but instead it either floods the landscape or spawns so much water the game freezes my system Lips Sealed

Gonna play some Dungeon Siege then come back to this
Logged
pixhead
Guest
« Reply #1768 on: February 27, 2011, 03:39:03 PM »

Just found out that my collision detection only works on squares. FUCK! Angry
Logged
Theophilus
Guest
« Reply #1769 on: February 27, 2011, 10:14:26 PM »

Having no clue how to go about detecting pitches and rhythms of an MP3/OGG/music file.
Logged
increpare
Guest
« Reply #1770 on: February 28, 2011, 12:33:53 AM »

Having no clue how to go about detecting pitches and rhythms of an MP3/OGG/music file.
google is your friend
Logged
iffi
Guest
« Reply #1771 on: February 28, 2011, 12:44:04 AM »

Just found out that my collision detection only works on squares. FUCK! Angry
Design your game around using solely squares.
Logged
ghosted
Level 0
***



View Profile
« Reply #1772 on: February 28, 2011, 04:55:27 AM »

Ugh. So I've been gathering up all the nice snippets of code from deceased projects and putting them together to form a tidy 2D engine framework for future projects and I'm just about done when I notice some weird behaviour in the Tilemap Editor when in Release mode. A bit of prying and it would appear lines of code are being skipped. I start to think I've bummed my memory somewhere so start dividing and conquering (tearing out chunks to find the responsible portion). I'm down to almost nothing and I'm still seeing weird things going on.

I've absolutely no clue what is causing this and it only appears in release mode. If I make a change, the 'funk' is still there but it's symptoms alter slightly.

My only suspicion is that I've started using VC++ 2010 Express and perhaps the compilers optimisation is responsible but the odds suggest it's my crap coding, not Microsofts.

I'm not adding any more code till I've nobbled this but why does this happen just when I'm gathering some great momentum!?
Logged
teomat
Guest
« Reply #1773 on: February 28, 2011, 05:29:51 AM »

Hnnnnggg... I'm working on a roguelike  and now I'm randomly generating caves:
Code:
####################
####################
#####     #####  ###
###        ###    ##
##   ###   ###    ##
##  #####  ##     ##
##  #####        ###
##  #####        ###
##  #####        ###
#   #####  ## #   ##
#   #####        ###
##  #####        ###
##   #####      ####
##    ####      ####
##     ##       ####
##          #    ###
###              ###
#######         ####
####################
####################

After I have that I search the outlines of the walls (using floodfill):
Code:
     #####     ##   
   ##.....#   #..# 
  #........# #....#
 #...###...# #....#
 #..#   #..##.....#
 #..#   #........# 
 #..#   #........# 
 #..#   #........# 
#...#   #..##.#...#
#...#   #........# 
 #..#   #........# 
 #...#   #......#   
 #....#  #......#   
 #.....##.......#   
 #..........#....# 
  #..............# 
   ####.........#   
       #########

And because I want to use line segments (box2d) for the walls I need to connect them. And I got no idea how to do that...
Everything was going so well... Cry
Logged
Tycho Brahe
Level 10
*****

λx.x


View Profile
« Reply #1774 on: February 28, 2011, 05:32:45 AM »

perhaps have the cartesiean coordinates of the wall cells as the ends of the line segments?
Logged
teomat
Guest
« Reply #1775 on: February 28, 2011, 05:36:13 AM »

perhaps have the cartesiean coordinates of the wall cells as the ends of the line segments?

Thats what I'm planning to do, I just need to know which tiles to connect so that the shapes of the walls are maintained. (should probably have mentioned that)
Logged
st33d
Guest
« Reply #1776 on: February 28, 2011, 05:53:52 AM »

Marching Squares algorithm:

http://wonderfl.net/c/mky0

I wrote this for a game that used Box2D and a map of tiles. It has some issues with diagonals though so you'll have to write something to cope with that.

And it doesn't do interiors unless you start the scan on the inside - but it's fairly efficient at cutting down the amount of edges you'll need.
Logged
teomat
Guest
« Reply #1777 on: February 28, 2011, 06:12:40 AM »

stuff
Great, I knew someone would know a solution for this  :-D
Thank you!
Logged
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #1778 on: February 28, 2011, 09:30:26 AM »

Ghosted based on what do you suspect lines are being skipped?
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
ghosted
Level 0
***



View Profile
« Reply #1779 on: February 28, 2011, 10:06:30 AM »

I'd chucked a mass of debug output messages in the strange areas and it indicated that simple lines of code with little in the way of dependencies simply weren't executing. But that's only the bit that related to the tilemap editor misbehaving.

Other funkiness involves random game objects being created and rendering but never updating. The objects in question are the same ones every time until I change code elsewhere (not even relating to entities) and recompile, then it's a different set of funky entities. Likewise, on some compiles, the player object will not update, but holding a movement key causes it to do a single frame of gravity update but ignore collisions. Given the simplicity of the update code etc (and the fact I'm not changing code relating to the affected objects) I suspect I've frigged my memory somehow. But all my best Sherlock Holmes'ing leads me to suspect it ain't me.

I think I might just download another compiler/ide such as codeblocks and see what that spits out.
Logged
Pages: 1 ... 87 88 [89] 90 91 ... 295
Print
Jump to:  

Theme orange-lt created by panic