Jump to content

storm runner redo


admalledd
 Share

Recommended Posts

so, here i am with too much time on my hands, and i have the old game storm runner...

so what did i do? i started recreating it, and because i believe in release early and often, i am handing out the first stepping stone of the game.

this header post will be where i keep my milestones, and how i am doing with the project.

  • milestone 1:

    • create map zone, and render only in that area---DONE
    • create mouse data container---DONE
    • actually have a proper way to make maps...---DONE

    [*]milestone 2:

    • basic map system---DONE
    • select and interact with tiles
    • start robot bay

    [*]milestone 3:

    • finish maps
    • pick-up-able items -- DONE
    • finish robot bay

    [*]more?

note: moved publishing to github (first time using git, be gentle!)

download from github

download page

Link to comment
Share on other sites

Anonymouse

Awesome! About the map format, you could go the same way as ORR-py might be doing - PNG. (see http://orr.skysimulation.de/browser/trunk/Map_Proposal.txt . It will be updated occasionally, so do check back ;)).

Link to comment
Share on other sites

that actually sounds pretty good!

i was thinking i might have to create massive data tables/hash trees in python to store all the data. this works really well!

*starts hacking at the code*

Link to comment
Share on other sites

Anonymouse

that actually sounds pretty good!

i was thinking i might have to create massive data tables/hash trees in python to store all the data. this works really well!

*starts hacking at the code*

That's nice :)

Also, you could probably pickle the data, but that would be much harder to edit.

Link to comment
Share on other sites

that actually sounds pretty good!

i was thinking i might have to create massive data tables/hash trees in python to store all the data. this works really well!

*starts hacking at the code*

That's nice :)

Also, you could probably pickle the data, but that would be much harder to edit.

well, you see, my idea is not really to use pickle for the map, because all i need is the tile locations, and the type:::

'''tile layout:::

folder_xxxx.gif

where xxxx is the direction and layout of the image.

axxx == top right

xaxx == bottom right

xxax == bottom left

xxxa == top left'''

import pygame

import tiles


map_size=(25,25)

sub_rect=pygame.Rect((0,0),(50,50))

main_rect=pygame.Rect((0,0),(500,500))

#(x,y):'tile hash name'

tile_locs={(0,0):'bbbr',(1,0):'rbbr',(2,0):'rbbb',

           (0,1):'bbrr',(1,1):'bbbb',(2,1):'rrbb',

           (0,2):'bbrb',(1,2):'brrb',(2,2):'brbb'}



def set_tiles(map):

    def set_tile(loc,type):

        map.map[loc][0].set_tile(type)

    for loc,value in map.map.iteritems():

        if loc in tile_locs:

            set_tile(loc,tile_locs[loc])
that is the code i currently have for the map data, i have a dict for the map in the form of:
{(x-loc,y-loc):(tile_instance,rect,random_other_data)}

kind of make sense?

Link to comment
Share on other sites

  • 3 weeks later...

well, i have made a significant update to the code: you now can move the rcx! yay!

other changes:

added a "vehicle" modual for all the rcx code (movement, and later: code engine?)

fixed a problem with the map where you would draw every tile, but now it is all rendered to a larger surface.

use of -v on the command line pushes the code into debug mode. more v's= higher debug.

made a basic map using a dungeon map generator for DND.(yay...)

made a map loader.

map file is a simple text file, editable in any text editor, currently '.' is walkable '#' is a wall.

again, download here

Link to comment
Share on other sites

Hmm, why don't you set it up as a project on sourceforge? That would get you SVN so you can get all minor updates to people who are watching or maybe want to help. :)

Link to comment
Share on other sites

mostly because im lazy and have yet to figure out how to use svn.

although, it does sound like a good idea for now... (if only google code supported git...)

also: i've only worked two days on this so far (one at the beginning, on one Saturday)

meh, off to figure out svn for the next update...

also: anyone have any ideas on how to make the "programming" gui for the robots?

Link to comment
Share on other sites

Addictgamer

also: anyone have any ideas on how to make the "programming" gui for the robots?

If you explain what you mean, I can attempt to help.

My response may be delayed though, since my internet is going down alot these days.

Link to comment
Share on other sites

also: anyone have any ideas on how to make the "programming" gui for the robots?

like the original click-and-drag one?

Link to comment
Share on other sites

yes. any ideas on how to implement that programming wise?

Implementing drag and drop is quite easy if you use the right libraries.

About the prgoramming of the robot, I just wqanted to share one of my ideas for the AI interface I had for my netbattle project:

When you program the robot, you are in fact making a list of commands. In code this is usually represented as an array. If you code the programming in such a way that you have a graphical version of the program, and an under-the-hood array that corresponds to the graphical version, you can either use "encoded" integers or objects as contents of the array to represent the program. So when the user adds a block to the program, there is also an integer or object added to the array.

Now when the program is ready to be run, you simply loop through the array and "parse" the commands it contains. Then the only thing left is to do it in such a way that it waits until a command is completed before it starts with a next one. So you will need to mess a bit aroundwith events.

I hope this helps and/or makes sense :P

Link to comment
Share on other sites

Command class - has a run method which executes the actual action. The class is pushed onto a list that defines the program flow. Have an integer that defines the position in the program flow.

Switch blocks are simply orders that skip to position x if they evaluate to true and to position y if they evaluate to false.

0-A Switch (eg. whatever input < 50) becomes if i < 50: iterator=1 ; else: iterator=3

1-Move forwards (code this however, I don't know about your interface)

2-skip to 4 => iterator=4

3-Move backwards

4-Quit

Get it? Probably not as simple as I think.

Link to comment
Share on other sites

Command class - has a run method which executes the actual action. The class is pushed onto a list that defines the program flow. Have an integer that defines the position in the program flow.

Switch blocks are simply orders that skip to position x if they evaluate to true and to position y if they evaluate to false.

0-A Switch (eg. whatever input < 50) becomes if i < 50: iterator=1 ; else: iterator=3

1-Move forwards (code this however, I don't know about your interface)

2-skip to 4 => iterator=4

3-Move backwards

4-Quit

Get it? Probably not as simple as I think.

Don't forget the animation part here.

A command class as you mention is indeed a good way to go, as it also allows to create some functions that monitor whether the animation that they start has finished, and can notify the location that called the command that the animation has finished, and is ready to execute the next command in the list (or have something like nextCommand(). It really is the same thing)

Link to comment
Share on other sites

thanks!

i have started the actual "programming" system (only the back-end right now...)

it is pretty much just what bartvbl said: list of commands. in short, my plan is to have a function (called every game loop) that updates the sprite with how it should look (pick up/movement animations) then, when the current animation is done, run a separate function to parse the next command out of the array (parse it just in case of decision blocks) and make that the current "animation" being run.

also, plan is to have an option to "save" pre-made control programs so that you don't have to re-create it every time...

i like the idea of making the code execution into its own object, and making it keep track of the current code state, i might try that if i get frustrated with the current idea.

Link to comment
Share on other sites

  • 1 month later...

Just a tip:

it is possibe to issue all commands at the same time, and have a timer run before it starts its animation. Then you just use the number of the entry in the array, multiplied by the period of time each command takes to determine how long this timer shouød run.

At least this is the way I did it with my game =)

Link to comment
Share on other sites

  • 2 weeks later...

Just a tip:

it is possibe to issue all commands at the same time, and have a timer run before it starts its animation. Then you just use the number of the entry in the array, multiplied by the period of time each command takes to determine how long this timer shouød run.

At least this is the way I did it with my game =)

Yes, that's generally a better way. At least, laby does that too :P

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.