Shop OBEX P1 Docs P2 Docs Learn Events
Ranquest Object Hacking: (From the Propellerpowered/GG forums) — Parallax Forums

Ranquest Object Hacking: (From the Propellerpowered/GG forums)

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2012-05-03 04:12 in Propeller 1
A few of us who have an interest in Propeller gaming have been conversing on the Propellerpowered/GG forums.

One of our members (Roadster) has been tearing into JT Cook's Ranquest video object with some amazing results.

file.php?id=61

Full thread is here: http://www.gadgetgangster.com/forums/viewtopic.php?f=4&t=119

I didn't think this should stay secret.. :)

OBC

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2012-04-30 19:49
    ...........I didn't think this should stay secret.. :)

    Definately not! Thanks for posting :)
  • potatoheadpotatohead Posts: 10,261
    edited 2012-04-30 20:49
    Looking pretty great!
  • JT CookJT Cook Posts: 487
    edited 2012-05-01 18:18
    I am glad to see some use out of it. That driver was mostly completed way back when I did Spinpong and Spintris (both should have that driver which is mostly the same except without the 1 BPP tiles). My intention was to create a stand alone driver, release some tools for it and throw it out there for use. But while the driver sat complete, I never finished the tools or made a proper example and code on how to use it and I moved onto other things.

    When Andre asked me to work on the C3, after I completed the porting process I did, I started a new game and pulled out this driver I had. The only thing I added at that time was 1BPP tiles so I can free up the tiles I was using for text to take up 1/8 the size.

    Hope some people can get some use out of this, and remember that it supports both NTSC and PAL!
  • blittledblittled Posts: 681
    edited 2012-05-01 19:00
    Is it safe to assume this driver is Public Domain although there is no MIT license? If so this will be perfect for a project I'm working on.
  • JT CookJT Cook Posts: 487
    edited 2012-05-01 22:15
    Yes, it is public domain, at least the original graphics driver I made for Ranquest is.
  • NurbitNurbit Posts: 53
    edited 2012-05-02 01:59
    I just wish I knew enough to do something with it :(
  • trodosstrodoss Posts: 577
    edited 2012-05-02 06:57
    Nurbit wrote: »
    I just wish I knew enough to do something with it :(
    Well, hopefully this will be enough to get you started...

    The graphics convert utility (GC.exe) is a command-line utility used to convert graphics from a standard bitmap format (like PNG) to one that is usable by the driver.

    There is not really a help file included with the code right now for how GC.exe is used, however here is what I have derived:

    GC.EXE [options]

    Options:
    [ -i ] indicates the input file being specified (in .png format)
    [ -b ] (bitmap flag) indicating tile size (8 or 16 in the case of the driver)
    [ -f ] indicates the output format [bitmap/sprite]
    [ -o ] indicates the output filename being specified

    Example: Generate the 8x8 tiles used in MsPac:
    gc.exe -i MsPacscrn.png -b 8 -f bitmap -o Mspac1

    Example: Generate the 16x16 sprites used in MsPac:
    gc.exe -i MsPacSpr.png -b 16 -f sprite -o Mspac1



    As far as the code, if you look at the MsPac.spin you will see how the driver is used. Since this is a sprite-based driver, it takes a little understanding of how they are structured in the code in order to use these.

    What "makes up" a sprite in the driver are the following:
     sprite_adr      - address of where sprites are stored
     sprite_x_adr    - X location of 8 sprites
     sprite_y_adr    - Y location of 8 sprites
     sprite_number   - address of images of 8 sprites
     sprite_x_flip   - flag to flip sprite on x axis
     sprite_y_flip   - flag to flip sprite on y axis
     sprite_color_01 - color #1 in the sprite that can be changed
     sprite_color_10 - color #2 in the sprite that can be changed
    

    In the actual code of the driver you will see these expressed like the following:
      byte[sprite_x_adr-2] := 100
      byte[sprite_y_adr-2] := 92
      byte[sprite_number-2] := 5
      byte[sprite_color_01-2] := $1c
      byte[sprite_color_10-2] := $7  
    

    In this case, the code (a pseudo-structure) is defining sprite #3 (which is why the values are -2), that is displayed at 100,92, using image #5, and has $1c defined as color #1, and $7 as color #2.

    The "sprite number" (or image) references the data that would have been generated by GC.exe, and indicates the 6th image (0-based) present in the file.

    Understanding that, most of the rest of the code in the MsPac.spin example should be at least a little easier to follow.


    If you still feel incredibly overwhelmed, there is another sprite-based driver that you could try here, It is lower resolution and has a few more limitations (NTSC only), however it is also fully functional, and public domain (MIT Licensed code).

    --trodoss
  • RoadsterRoadster Posts: 209
    edited 2012-05-02 13:40
    @Trodoss, thanks for giving your input on how to use my graphics converter program (gc.exe)
    I really need to find the time to document all the options
  • RoadsterRoadster Posts: 209
    edited 2012-05-02 18:12
    Here is a quick list of the options available for my graphics converter for the ranquest driver

    -i input graphic filename, will except any graphic file format supported by .net
    -o output filename (optional)
    -f conversion format options bitmap, tile, sprite
    -b pixel bits 16 for sprites, 16 / 8 for tiles, tiles with 16 bits also creates 4x4 tile map
    -s use saturated colors true / false (optional default is true)
    -c conversion color space rgb and lab (optional default is rgb)
    -w color weight 0-99% (optional) format rr_gg_bb, this doesn't always work as expected
    -t common tile set bitmap, Not finished
    -v VGA conversion, Not finished
  • NurbitNurbit Posts: 53
    edited 2012-05-03 04:12
    I'll sit down with this when I've got some free time.
    I'm buying a house at the minute so my free time has been somewhat limited over the past couple of weeks :(
Sign In or Register to comment.