Let's get programmy!

If you have some randomness to share that you can't post elsewhere, this is the place to do it.
Post Reply

Is Assembly the best programming language?

Yes
3
9%
Oh God my eyes
3
9%
Oh God my brain
12
38%
I perform unholy incantations to keep Assembly at bay
4
13%
Real men write binaries by hand
10
31%
 
Total votes: 32
User avatar
Chekhov MacGuffin
Community Scholar
BAGA BGEGD EDBDEG A

Posts:
2684

Re: Let's get programmy!

Post by Chekhov MacGuffin »

Akonyl wrote: far as I know, ranger's the only non-CS person here, although Kirby's major is probably called something different because he's doin game-oriented stuff.
I wish I had some CS. I did Java once, but that leaked out the brain long ago. I'll probably pick up something in the near future. How else will I control my lab chemical spewing death machine scientific apparatus?
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

personally, I think uncontrolled death machines are just fine the way they are.
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

...Glados?
Image
Image
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Does anyone know of a good way to locate memory leaks????
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

I haven't used any myself, but there's tools you could use for it. Like this page lists some things you could use in the Visual C++ debugger:
http://www.codeguru.com/forum/showthread.php?t=312742
which apparently tries to tell you the file+line that you dropped the memory on. Dunno how precise it is though as I've never used it.

aside from that, I'd just say to open the task manager while the program is running, and monitor the program's memory usage and how it grows depending on what happens in the program. But that doesn't always help.
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

Anyone play around with MIPS before?  Just started learning about the ISA for it as kind of a side project for a class...pretty interesting, considering the fact that it was used for the PS2 and PSP = possible awesome future projects
Image
Image
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Haha yeah no that opening the task manager won't help isn't I needed to recreate the iterative deepening search algorithm to solve a 15-slider puzzle. It works fine with a 15-slider puzzle but when I go and do the 8 slider puzzle it says that the memory has been corrupted, could be the amount of nodes that were created to get the board state. However there is one thing that bothers me about the homework. They wanted me to recreate it and have it solve the puzzle in less than 20 seconds. However it takes A* with the Manhattan distance heuristic to solve a normal 8 slider puzzle 17 seconds..... Iterative deepening takes about 10 to 100 times longer depending. This homework made no sense to me at all.

@ranger: No I haven't but it does sound interesting.
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

ah, figured you might be doing something game-related, not homework that happens instantaneously :V

anyway, all I can think of is to hash each state as you come to it to make sure you haven't encountered it yet to cut down on branching, but I figure you've probably done something of the sort already. Thread it?  :-X

@ranger: if MIPS is what I'm thinking of, isn't that just a chip architecture like x86/etc? If so I'm not sure why you'd ever use it for PS2 development unless you liked programming assembly :P
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Yeah I reduced the branching using something similar to a hash table. And it is running the way its supposed to, but in 20 seconds the iterative deepening search can't reach the solution, unless its like the best case.

So I found something for memory leaks in c++ Visual Leak Detector. And thats helping somewhat. Although.... I had a bad hunch that was were my leaks were coming from.

/sigh
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

hm? You had a hunch that the leak detector's where your leaks were coming from in the first place? I'm probably confused by something because that seems circular to me :x

also, are you sure that your algorithm's as efficient as it could be? Not in the total function calls but in like the board copying/analysis/etc. And are you doing any saving-off of branches so that you don't have to make your way back when the depth is increased?
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Haha no and you know that's not what I meant. I meant I knew where the leaks were kind of, but was assured based on what the leak detector told me. Anyway no more leaks=D so its all patched up. =P

Actually doesn't iterative deepening search require you to go all the way back? Since thats how its structured? This algorithm isn't supposed to be the most efficient. A* with a good heuristic is. But I still think that 20 seconds isn't that much time for either algorithm to solve the puzzle
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

well yeah I know it's not what you meant, but I didn't know what you were actually saying, but gotcha :P

and sure you're "supposed" to go all the way back, but if you search a path like (just choosing numbers without meaning) 1-2-1-3-2-1 and then the rest of that level, and then iterate to the next level of depth, when it comes time to calculate the path 1-2-1-3-2-1-2 there's no reason to calculate the first part of the path if you can cache the result off somewhere. And yeah I know it's not the most efficient method compared to A*, but if it's what you have to do for the assignment then I'm just tryin to think of ways to make it run a bit faster. :P

It's sorta like the recursive(bad) way to calculate the fibonacci sequence, sure you could just do the simple recursion and be done with it, but just because you're doing it recursively doesn't mean you can't save off some values so you don't have to calculate em again.
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

Akonyl wrote: @ranger: if MIPS is what I'm thinking of, isn't that just a chip architecture like x86/etc? If so I'm not sure why you'd ever use it for PS2 development unless you liked programming assembly :P
yeh its an ISA like x86 and LC-3 etc etc.  Programming assembly has its perks, its aight.  All the ps2 games are written in MIPS assembly since the source code has to deal with the chip processor.  I was even thinking of maybe like loading up some type of linux OS on it
Image
Image
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Well to be fair this homework used to be where we ran both A* and Iterative deepening. And so the 20 seconds applied to both, although I'm sure that the professor meant it to be for the A* and not the Iterative deepening one.
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

ah. Well then, yeah you wouldn't have to worry about most of that stuff :P
ranger wrote:
Akonyl wrote: @ranger: if MIPS is what I'm thinking of, isn't that just a chip architecture like x86/etc? If so I'm not sure why you'd ever use it for PS2 development unless you liked programming assembly :P
yeh its an ISA like x86 and LC-3 etc etc.  Programming assembly has its perks, its aight.  All the ps2 games are written in MIPS assembly since the source code has to deal with the chip processor.  I was even thinking of maybe like loading up some type of linux OS on it
I'm doubting anyone wrote PS2 games in straight MIPS assembly rather than in some C-like language with a PS2-specific compiler though. I mean sure specific parts may have been written in assembly blocks, but I feel like most games past SNES-era got too complex for that type of thing.
Post Reply