I have been working on Pacman in PTC! Everything is great, except for the AI... Turns out the Pacman AI is pretty simple, but I can't get it to work. Pacman AI is actually cool. Google "how pacman ai works" or something similar and it will tell you everything. Every ghost in Pacman has a different personality. Expect the QRs once I get the AI to work.
Only one ghost is after Pacman. The other 3 are going for positions near him. I forgot the positions, though...
Wow! You posted about that blog!
If you're wondering why I'm so happy about that well, I used to be terrible at SmileBASIC but that helped me a lot!
But then I decided to stop checking the blog because he stop posting on it.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens. Wait was that just a joke?
3DS Friend Code: 1478-3545-5136 | Nintendo Network ID: GreatGamer123
Remove spaces wherever possible. Some common examples of this:
FOR I=0TO 5
IF X==3GOTO@LABEL
?"Hello"
Try to avoid assigning values to variables to often. Do this:
Y=(2+2)*5
instead of
X=2+2
Y=X*5
Don't do everything in one frame. Instead of: @LOOP
GOSUB@MOVE
GOSUB@TSCREEN
GOTO@LOOP
do: @LOOP
ST=!ST
IF ST THEN GOSUB@MOVE
IF !ST THEN GOSUB@TSCREEN
GOTO@LOOP
Only do some things if an input is on/off. You can even better reduce lag above by doing: @LOOP
ST=!ST
IF ST AND BUTTON()THEN GOSUB@MOVE
IF !ST AND TCHST THEN GOSUB@TSCREEN
GOTO@LOOP
If you're comparing if a number is 0 or 1, you can shorten it like above. Instead of:
IF APPLE==1THEN GOSUB@APPLE
IF GRAPE==0THEN GOSUB@NOGRAPE
do:
IF APPLE THEN GOSUB@APPLE
IF !GRAPE THEN GOSUB@NOGRAPE
Longer labels/strings/variables mean more lag. It is very little, but it makes a big difference is large amounts. Instead of:
AREALLYLONGSTRING$="Hi"
AREALLYLONGVARIABLE=2
GOTO@AREALLYLONGLABEL
Do:
S$="Hi!"
V=2
GOTO@L
I hope these help your coding! (Try to do these at the end. After doing these, it's a nightmare to maintain.)
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
Over 1/4 of Minecraft DS's code has now been changed according to the above post! (Modders beware! You're in for a nightmare!)
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
Hey guys,I haven't been using PTC often, nor have I been on this forum. But I recently started using it, and now I have obtained the knowledge to successfully move a sprite! I also made a cool sprite sheet for a character, and I'm super excited that I've gotten this far. I'm now going to program my character to stab a sword! If anyone wants to help me with some coding, go right ahead!
EDIT: I'm currently programming right now, and I have a question: Can I used BTRIG like this?:
IF BTRIG()==16 AND 1 THEN (command here)
You just made my day. Those sprites are quite big, what sort of "bit" are they? I'm thinking of using some Mega Man X sprites for... something, and I need to know what sprites I can use. It's X1-X3 or X4-X6 sprites. SNES and PS1 sprites. Look up gameplay on YouTube for the sprites.
NO!
So I haven't been active code-wise, my DSi ran out of power and I couldn't find the charger just to tell people why I haven't been working on projects much.
@ramstrong Lol I can't believe you brought up Voronoi diagrams, because I happen to be making a Nearest Neighbor classifier for my Pattern Recognition class (which splits up the feature space into Voronoi cells based on which point is closest). I see that it's connect the dots now, thanks for the explanation. And thank you for the credit.
Haha. You're working on Voronoi diagram and can't recognize it when you're looking at one? Oh, dear. Some kind of student you are. Well, at least you have something very cool to show your teacher.
What kind of class is Pattern Recognition, anyway? Is this some kind of graduate level course? I don't think I've seen one. Any textbook?
I guess I'll be making a few more experiments with this Voronoi diagram thing. I still have other things to do, though. Still, this is very, very interesting research materials. For example, which point is the closest if you have to take walls into account? What about enclosing walls? And so on. Once I complete this, I'll have a subroutine that you can just plug in to do Virtual Keyboard and other things.
@IAmAPerson
Now of course, if you don't know the language, it'll look like |*,<_$]#{%
Why not just release the one you have now and update later? You can put it (weighted) random for ghost AI for now.
@GraphicGenius
But then I decided to stop checking the blog because he stop posting on it.
I'm still posting on mine, though it's been Raspberry Pi materials lately. There's enough materials that I can use to built my own Nintendo 2DS, except at twice the price, and doesn't play any of Nintendo games. Raspberry Pi+7"HDMI+Teensy+Double Stick Joypad should do it. A little bit more money for Touchscreen+controller. Adafruit just released one for Arduino. Hmmm. Maybe I should knock off a quick game library for Raspbian based on PetitComputer!
@ramstrong I'm using handy dandy lag-reducing shortcuts there. This: @LOOP
ST=!ST
IF ST THEN GOSUB@MOVE
IF !ST THEN GOSUB@TSCREEN
GOTO@LOOP
written out the long way is: @LOOP
IF ST==1 THEN ST=0 ELSE ST=1
IF ST==1 THEN GOSUB @MOVE
IF ST==0 THEN GOSUB @TSCREEN
GOTO @LOOP
On the first frame, it'll @MOVE but not @TSCREEN. On the following frame, it goes to @TSCREEN and not @MOVE. This way, not everything is done in one frame, reducing lag.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
@ramstrong I'm using handy dandy lag-reducing shortcuts there. This: @LOOP
ST=!ST
IF ST THEN GOSUB@MOVE
IF !ST THEN GOSUB@TSCREEN
GOTO@LOOP
Well, it would helped had you put in 2 different subroutines instead of just one. Anyway, what you're doing is doing timeslice operation. This can be generalized as
Just in case you have rather long clock ticks. But the drawback is you have switching overhead. Still, if you can split your code that way, this represent a primitive multi-threading operation.
I screwed my code up. Great.
So anyways I'm trying to reintegrate slashing, using DIREC, a variable. Each time you walk a direction, it assigns a number to DIREC. I'm trying to slash left, I get a syntax error.
Here's my code:
IF DIREC==4 AND BTRIG()==16 THEN GOSUB @SLASHLEFT
@ramstrong putting 2 of the same subroutines was a typo, sorry. Anyway, yea. I changed about 300-350 lines of the Minecraft DS code to make it faster, and I'm still not done. If you guys don't enjoy, I will forever hate myself.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
now that the main gameplay of aottg is near complete, besides a few ai tweaks, i'm going to spend some time on aesthetics to make it look good. atm i added a falling animation for titans so they don't just disappear when they die, i added a short intro scene when you start a mission, and i added a few more attacks for the titans so you can no longer feel safe when near a titan d: because of these new attacks, playing in the forest with an npc has so much lag it's almost unplayable. i'm going to try doing what persson said and see if it makes it any better. i also worked on the colossal titan, and (spoiler alert) because he's actually just a titan shifter and not actually a titan it wouldn't make sense for him to just die so i made his human form appear and start running away and you have to capture him to win. on the wiki chat today, i noticed a lot of people complaining about the limited amount of swords and asking to make it infinite. i'm not going to do that because that would take away the challenge and easy is usually boring. if you want to use your swords without breaking them all right away, you have to start making your hits more accurate or it'll just wear out your blades. the only way you can kill a titan is with one hit to the neck. tl;dr not adding infinite swords. i was also thinking of adding deviant titans, but that would require more sprites and i still have to finish the other character sprites, and it would take a lot of coding and it would probably lag. i'm definitely going to attempt it though i'm also considering all (reasonable) suggestions that i get, so if you have any suggestions or requests just let me know.
get in loser we're going titan hunting
3DS Friend Code: 2879-0639-8952 | Nintendo Network ID: merp_aottg
@ramstrong@randomous where do you guys learn this stuff? Can I have a book,on generic programming methods?
@ramstrong Great to see you back! Heh. I REALLY need to continue work on ptc community :/.
Nowadays, I use the Internet. Back before then, I used to just go to local University and buy books off their bookstore. Whenever I need more, I go to library and hit graduates' research papers. As long as I have the books, can link them to actual course numbers, I'm fine. It's not like they'll check your id unless you're checking out books and stuff. Time it during course registration period and no one cares.
Where is Morphtorok, anyway? I hope he didn't get Pokemon or we'll never get him back! Very addictive. It's the only game where I have withdrawal symptoms when not playing after a while.
EDIT:
Algorithms in C++ by Robert Sedgewick is a good generic all-purpose programming book. It's based on The Art of Computer Programming by Prof Donald E. Knuth. If you want game graphic specific, I can recommend Andre LaMothe's book. Or maybe Michael Abrash books. I hope I didn't just date myself. ^_^; But I can't find any good book of recent vintage. I'll have to hit man pages for SDL2.
@JLMan
Well, don't call it Pacman, then. Just call it, Odd Travellers in Mystery Maze or something.
Forums
Topic: Petit Computer
Posts 7,801 to 7,820 of 9,620
Please login or sign up to reply to this topic