Somewhat of a x-post from CW, but I’ve added more information.

I’m interested in helping design levels, and I have about 12 levels completed, ranging in difficulty from mundane to challenging. I think I will make a few more, then PM you the level data, or even post it here.

I’m also working on an algorithm to generate levels procedurally, but it’s quite the challenge. You specify the number of turns, and it tries to generate a level. The levels generated currently look like the “open” levels you recently posted on CW, but they aren’t always possible... I am trying to implement more complex levels, with the “damage” blocks, and the things that “move” other blocks when you move through them.

Here’s how the level generator works:

0) It asks you for a difficulty
1) It picks a point on the edge to place the package.
2) It picks a direction not impeded by a wall, and keeps going in that direction. It also picks a random number, between 3 and 8, that represents the maximum distance.
3) It stops if it runs into a wall/other block, or if it has gone the aforementioned maximum distance, and places a block in the direction it is facing. (To stop the player when the level is actually played.)
4) It then picks a direction that is +-90°, and isn’t impeded by a wall.
5) It subtracts one from the number you gave it as the “difficulty”, and repeats steps 2-5 until it is zero.
6) It then places a goal block at the spot where it ends up.

There are several notable flaws with this algorithm:

1) It may place a block in the middle of a pre-existing path.
2) It may place the finish in the middle of a pre-existing path.
3) It may replace the package with a block or the finish.
4) It may make the level too easy by putting the finish in a place where it can be reached at a previous “stopping point”
Good job! We now only have to see if the levels turn out to be fun to play. (Of course, we'd need some human-designed levels, too Wink ).
They aren’t fun to play, yet. I still need to make it better.

It also takes a while for it to generate a level. (~30 seconds for difficulty 5)

I’m thinking that, because this is pseudorandom and will work across calcs, you could implement this so that the game could have a game mode where it generates levels infinitely, and your score is based off of the number of levels you can beat.

Of course, this will be after the levels generated look good, are always playable, and can use all of the features.
_iPhoenix_ wrote:
They aren’t fun to play, yet. I still need to make it better.

It also takes a while for it to generate a level. (~30 seconds for difficulty 5)

I’m thinking that, because this is pseudorandom and will work across calcs, you could implement this so that the game could have a game mode where it generates levels infinitely, and your score is based off of the number of levels you can beat.

Of course, this will be after the levels generated look good, are always playable, and can use all of the features.

That actually sounds awesome! If this is feasible within the limit of what the calc will run (8K iirc), this will be a welcome addition!

I've just made a reset button. It'll come in handy for any problems we might encounter with that Laughing
Bump.

Added [MODE] as a reset button, and now the game has 7 levels.



Download here, and level editor here.

Suggestion time! Should I add a "score" mechanism to record the lowest number of moves you have made? Should I add a way to play singular custom levels? How would you feel about a menu? Why am I asking you all these questions instead of coding them?
I’d like the ability to import levels from lists in the editor. A Main menu would be cool, perhaps play the truck animation on the top of the screen. Perhaps have it like golf; you have a par and maximum strokes per level. At the end, there should be a highscores table, showing the minimum possible and maximum possible score, and the top ten scores by you.
I created a level, but how do you put it into the game?

Also, can you make it so that every level is locked, but when you beat one, it unlocks it, and you can choose from a level selection screen?
jcgter777 wrote:
I created a level, but how do you put it into the game?

Also, can you make it so that every level is locked, but when you beat one, it unlocks it, and you can choose from a level selection screen?

How I'm personally putting levels from the level editor into the game is recalling L1 at some place in my code, and having that list be stored into L1 when J (the level number) is a certain number. However, I am working on a menu, of which one of the options will be to play a level from a custom named list.

For now, do

Code:
L1→NAME

where NAME is replaced with a name you choose (up to 5 characters; first character must be A-Z, others are alphanumeric). Once I am done with the menu system I'm adding, I will put in a custom level loader, in which you will simply have to enter that name.
How will implementation of custom packs work? Will it be a sepatare program or inside of the program itself as an appvar?
xMarminq_ wrote:
How will implementation of custom packs work? Will it be a sepatare program or inside of the program itself as an appvar?

Custom levels (singular levels, not "packs" in the strictest sense) will be custom named lists. Because of the limitations of TI-BASIC, the level from the editor is exported to L1, and you must then store L1 to a named list. You will then be able to, within an option in the game, type that name, and the level will be recalled.

Later today, I plan to release a working menu for the game, which will also save your progress.
xMarminq_ wrote:
Because of the limitations of TI-BASIC, the level from the editor is exported to L1, and you must then store L1 to a named list. You will then be able to, within an option in the game, type that name, and the level will be recalled.
I think TI-BASIC may limit even this. How will you be able to translate a string, such as Str1, into a named list? I don't think that LStr1 will work in this case.

EDIT: Just checked. It won't work. Just use a set of named lists to choose from, and store L1 into those, without ever having to leave the program.
EDIT 2: You should post the source code so we can help you with optimization!
CalcMeister wrote:
xMarminq_ wrote:
Because of the limitations of TI-BASIC, the level from the editor is exported to L1, and you must then store L1 to a named list. You will then be able to, within an option in the game, type that name, and the level will be recalled.
I think TI-BASIC may limit even this. How will you be able to translate a string, such as Str1, into a named list? I don't think that LStr1 will work in this case.

EDIT: Just checked. It won't work. Just use a set of named lists to choose from, and store L1 into those, without ever having to leave the program.
EDIT 2: You should post the source code so we can help you with optimization!

No, that's not how it works. ʟLIST, ʟABC, and ʟDSCNT are examples of named lists. In order to get the contents of a list named by Str1, just do

Code:
expr("ʟ"+Str1→L1

and use L1 from there. Trust me, I have this figured out.
Bump.

Added a menu, with instructions, custom level playing, and a truck!



Download here, and level editor here. Suggestions and improvements welcome! I'd also like some more levels.
For some reason, in both the custom and normal packs, the inverted equal sign thing disappeared, making it really hard to do unless you memorized the locations.
jcgter777 wrote:
For some reason, in both the custom and normal packs, the inverted equal sign thing disappeared, making it really hard to do unless you memorized the locations.

Hm, that's weird. Can you show me exactly what that looks like? That shouldn't happen.
There are none of the black boxes, only reflectors, your character, and the destination.
jcgter777 wrote:
There are none of the black boxes, only reflectors, your character, and the destination.

What model are you playing on? Perhaps it could be an oddity with a certain model I don't have.
I think it was around Level 9 or 10, but I encountered an 'Invalid Dimension' error. When I started the game again, it brought me back to the beginning.

When I press Goto it brings me to the closing parentheses of L1(D) on line 149
L1 = {1,24,1}
D=4
J=9 (I think thats what variable you use to count which level I'm on

Other than that bug, I really like this game!
TheLastMillennial wrote:
I think it was around Level 9 or 10, but I encountered an 'Invalid Dimension' error. When I started the game again, it brought me back to the beginning.

When I press Goto it brings me to the closing parentheses of L1(D) on line 149
L1 = {1,24,1}
D=4
J=9 (I think thats what variable you use to count which level I'm on

Other than that bug, I really like this game!

Whoops, I forgot I didn't program a level 9 yet! There only exist level lists for up to J=8 (and there's no default level). That's the only problem there. This will be fixed in a later update.

Oh, and about it starting you back at the beginning: it does that whenever the data in the list is corrupted or incorrect. The level number is stored back into the savefile list after playing each level, but the storing of the verification element only happens at the menu screen (preventing people from, say, quitting with ON).
JWinslow23 wrote:
CalcMeister wrote:
xMarminq_ wrote:
Because of the limitations of TI-BASIC, the level from the editor is exported to L1, and you must then store L1 to a named list. You will then be able to, within an option in the game, type that name, and the level will be recalled.
I think TI-BASIC may limit even this. How will you be able to translate a string, such as Str1, into a named list? I don't think that LStr1 will work in this case.

EDIT: Just checked. It won't work. Just use a set of named lists to choose from, and store L1 into those, without ever having to leave the program.
EDIT 2: You should post the source code so we can help you with optimization!

No, that's not how it works. ʟLIST, ʟABC, and ʟDSCNT are examples of named lists. In order to get the contents of a list named by Str1, just do

Code:
expr("ʟ"+Str1→L1

and use L1 from there. Trust me, I have this figured out.
Genius! I hadn't even thought of that! You should still try to keep the program self contained, though. See if you can make a way to create custom named lists as well, so you never have to exit the program! For this, I'd recommend storing them in strings.

Code:
Input "Level Name:",Str1
Str1->Str2
For(A,1,8-length(Str2
Str2+" "->Str2
For(A,1,dim(L1
Str2+toString(L1(A->Str2
End
//This program assumes that each element of L1 is only 1 digit.

EDIT: For calcs without toString(, you can replace

Code:
Str2+toString(L1(A->Str2

with

Code:
Str2+sub("0123456789",L1(A)+1,1->Str2
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 4
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement