Simple Game framework

Game development specific discussions.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Simple Game framework

Post by BasicCoder2 »

UPDATE: 16th March 2017

While playing with a trial version of RPG Maker VX Ace I wrote this simple version which I had intended to enhance over time including adding the tile editor.
The player agent is assigned to ag(0) and the moving block is assigned to ag(agentCount-1) all the agents in between are in this example the "bad guys".

What I left out in the previous version was killing the bad guy when hit with a block. The addition is on line 207,
'===THIS SECTION TESTS FOR MOVING BLOCK HITTING ANOTHER SPRITE ==

First you must run this to create the image shared at this stage by all agents.

Code: Select all

screenres 640,480,32
dim as any ptr image
image = imagecreate( 96, 128)
dim as ulong colors( 9)
colors( 0)=RGB(255,0,255)
colors( 1)=RGB(0,0,0)
colors( 2)=RGB(136,0,21)
colors( 3)=RGB(255,174,201)
colors( 4)=RGB(34,177,76)
colors( 5)=RGB(63,72,204)
colors( 6)=RGB(255,127,39)
colors( 7)=RGB(168,67,0)
colors( 8)=RGB(0,162,232)
    dim as integer n
    for j as integer = 0 to  127
        for i as integer = 0 to  95
            read n
            pset image,(i,j),colors(n)
        next i
    next j
bsave "agent.bmp",image

DATA  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA  0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
And here is the demo. You control the player with the arrow keys.

Code: Select all

const WORLDW = 13
const WORLDH = 15
const TILEW = 32
const TILEH = 32
const SCRW  = WORLDW*TILEW
const SCRH  = WORLDH*TILEH

type AGENT
    as integer x         'current position
    as integer y
    as integer w
    as integer h
    as integer dx        'velocity between -1 and +1
    as integer dy
    as integer d         'direction
    as integer f         'current frame
    as integer tf        'total frames
    as integer count     'delay between frame increment
    as integer ID
    as any ptr img       'sprite image block
    as integer a         'sprite being used
end type

dim shared as integer count  'frame delay

dim shared as integer blkID
dim shared as integer agentCount
agentCount = 5   'player = 0 and block = agentCount-1
blkID = agentCount-1

dim shared as integer WINX,WINY,WINW,WINH

screenres SCRW, SCRH, 32
color rgb(0,0,0),rgb(255,255,255):cls
chdir exepath() ' !!! for image loading be sure it's the right folder 

dim shared as any ptr block1
block1 = imagecreate(96,128)
'paint images in block
for j as integer = 0 to 3
    for i as integer = 0 to 2
        line block1,(i*32,j*32)-(i*32+31,j*32+31),rgb(255,i*100,0),bf
        line block1,(i*32,j*32)-(i*32+31,j*32+31),rgb(0,0,0),b
    next i
next j

dim shared as any ptr greenBlob
greenBlob = imagecreate(96,128)
bload "greenBlob1.bmp",greenBlob

dim shared as any ptr redPenguin
redPenguin = imagecreate(96,128)
'bload "redPenguin1.bmp",redPenguin
bload "critter.bmp",redPenguin

dim shared as AGENT ag(0 to agentCount-1)

for i as integer = 1 to agentCount-2  'skip player ag(0) and player(agentCount-1)
    ag(i).w = 32
    ag(i).h = 32
    ag(i).y = 0
    ag(i).x = i*TILEW*2
    ag(i).id = i
    ag(i).dx = int(rnd(1)*3)-1
    ag(i).dy = int(rnd(1)*3)-1
    while ag(i).dx = 0 and ag(i).dy=0
        ag(i).dx = int(rnd(1)*3)-1
        ag(i).dy = int(rnd(1)*3)-1
    wend
    ag(i).img = greenBlob
    ag(i).a   = 1
next i

ag(0).id  = 0
ag(0).w   = 32
ag(0).h   = 32
ag(0).img = redPenguin
ag(0).a   = 1

ag(blkID).id   = blkID
ag(blkID).w    = 32
ag(blkID).h    = 32
ag(blkID).x    = 32
ag(blkID).y    = 0
ag(blkID).dx   = 0
ag(blkID).dy   = 0
ag(blkID).img  = block1
ag(blkID).a    = 0


dim shared as integer world(WORLDW,WORLDH)
for j as integer = 0 to WORLDH-1
    for i as integer = 0 to WORLDW-1
        read world(i,j)
    next i
next j

function spriteCollision(b1 as AGENT,b2 as AGENT) as boolean
    return b2.y < (b1.y + b1.h) and (b2.y + b2.h) > b1.y and b2.x < (b1.x + b1.w) and (b2.x + b2.w) > b1.x
end function

sub drawWorld()
    screenlock
    cls
    'draw tiles
    for j as integer = 0 to  WORLDH-1
        for i as integer = 0 to WORLDW-1
            if world(i,j)=1 then
                line (i*TILEW,j*TILEH)-(i*TILEW+TILEW,j*TILEH+TILEH),rgb(100,100,200),bf
            end if
            if world(i,j)=2 then
                line (i*TILEW,j*TILEH)-(i*TILEW+TILEW,j*TILEH+TILEH),rgb(200,100,100),bf
            end if
        next i
    next j
   
    'draw agents
    for i as integer = 0 to agentCount-1
        if ag(i).a = 1 then
            if ag(i).dx = 0 and ag(i).dy = 0 then ag(i).f = 1
            draw string (ag(i).x,ag(i).y),str(i)
            put (ag(i).x,ag(i).y),ag(i).img,(ag(i).f*32,ag(i).d*32)-(ag(i).f*32+31,ag(i).d*32+31),trans
        end if
    next i

    screenunlock
    
end sub

sub makeMove(ag as AGENT)
    ag.x = ag.x + ag.dx
    ag.y = ag.y + ag.dy
end sub
    
function outOfBounds(ag as AGENT) as boolean
    if ag.x < 0 or ag.x > SCRW-TILEW or ag.y < 0 or ag.y > SCRH-TILEH then
        return TRUE
    else
        return FALSE
    end if
end function

function tileCollision(ag as AGENT) as boolean
    dim as boolean hit
    dim as integer TILEX,TILEY
    'test overlap of another tile
    TILEX = int(ag.x/TILEW)
    TILEY = int(ag.y/TILEH)
    if world(TILEX,TILEY)<>0 then hit = 1

    TILEX = int((ag.x+TILEW-1)/TILEW)
    TILEY = int((ag.y)/TILEH)
    if world(TILEX,TILEY)<>0 then hit = 1

    TILEX = int((ag.x)/TILEW)
    TILEY = int((ag.y+TILEH-1)/TILEH)
    if world(TILEX,TILEY)<>0 then hit = 1

    TILEX = int((ag.x+TILEW-1)/TILEW)
    TILEY = int((ag.y+TILEH-1)/TILEH)
    if world(TILEX,TILEY)<>0 then hit = 1
    
    return hit
    
end function
       
sub undoMove(ag as AGENT)
    ag.x = ag.x - ag.dx 'undo move
    ag.y = ag.y - ag.dy
end sub
    
sub changeDirection(ag as AGENT)
    ag.dx = int(rnd(1)*3)-1
    ag.dy = int(rnd(1)*3)-1
    while (ag.dx and ag.dy) or (ag.dx=0 and ag.dy=0)
        ag.dx = int(rnd(1)*3)-1
        ag.dy = int(rnd(1)*3)-1 
    wend
end sub
    
function onTile(ag as AGENT) as boolean
    if ag.x = int(ag.x\TILEW)*TILEW and ag.y = int(ag.y\TILEH)*TILEH then
        return TRUE
    else
        return FALSE
    end if
end function

sub setDirection(ag as AGENT)
    If ag.dx < 0 then ag.d = 1
    If ag.dx > 0 then ag.d = 2
    If ag.dy < 0 then ag.d = 3
    If ag.dy > 0 then ag.d = 0 
end sub

sub upDateFrame(ag as AGENT)
    ag.count = ag.count + 1
    if ag.count>10 then
        ag.count = 0
        ag.f = ag.f + 1
        if ag.f = 3 then ag.f = 0
    end if
end sub

sub update()
    
    '===THIS SECTION TESTS FOR MOVING BLOCK HITTING ANOTHER SPRITE ==
    if ag(blkID).a = 1 then 'if moving block active
        for j as integer = 0 to agentCount-2 'for each other sprite
            if ag(j).a = 1 then 'it exists
                if spriteCollision(ag(blkID),ag(j)) = TRUE then
                    ag(j).a = 0  'sprite dead
                end if
            end if
        next j
    end if
    '================================================================
    
    dim as integer hit
    
    for i as integer = 0 to agentCount-1
        
        if ag(i).a = 1 then
        
            hit = 0
        
            makeMove(ag(i))
        
            if outOfBounds(ag(i)) then
                hit = 1
            end if
        
            if tileCollision(ag(i)) then
                hit = 2
            end if
        
            updateFrame(ag(i))
        
            for j as integer = 0 to agentCount-1 'for each other sprite
                if i <> j then  'not with itself
                    if ag(j).a = 1 then 'it exists
                        if spriteCollision(ag(i),ag(j)) = TRUE then
                            hit = 3
                        end if
                    end if
                end if
            next j
        
            if hit <> 0 then
                
                if i = blkID then
                    if hit = 1 or hit = 2 then 
                        undoMove(ag(blkID))
                        ag(blkID).a = 0
                        world(ag(blkID).x\TILEW,ag(blkID).y\TILEH)=1
                    end if
                else
                   undoMove(ag(i))
                   if i<>0 then  'not player
                       changeDirection(ag(i))
                       setDirection(ag(i))
                   end if
               end if
    
            end if
        end if
        
    next i
    
    'read player input if on center of tile
    if onTile(ag(0)) then
        
        ag(0).dx = 0
        ag(0).dy = 0
        'only one of four directions possible
        If MultiKey(&H4B) then ag(0).dx = -2:ag(0).dy = 0
        If MultiKey(&H4D) then ag(0).dx =  2:ag(0).dy = 0
        If MultiKey(&H48) then ag(0).dy = -2:ag(0).dx = 0
        If MultiKey(&H50) then ag(0).dy =  2:ag(0).dx = 0
        setDirection(ag(0))
        
        '=====  THIS SECTION ACTIVATES AND SET MOVING BLOCK MOVING ====
        if multikey(&H39) then
            if ag(0).d = 0 and world(ag(0).x\TILEW,ag(0).y\TILEH+1)<>0 then  'moving down
                world(ag(0).x\TILEW,ag(0).y\TILEH+1)=0
                ag(blkID).dy = 1
                ag(blkID).dx = 0
                ag(blkID).a = 1
                ag(blkID).x = ag(0).x
                ag(blkID).y = ag(0).y+32
            end if
            if ag(0).d = 1 and world(ag(0).x\TILEW-1,ag(0).y\TILEH)<>0 then 'moving left
                world(ag(0).x\TILEW-1,ag(0).y\TILEH)=0
                ag(blkID).dx = -1
                ag(blkID).dy = 0
                ag(blkID).a = 1
                ag(blkID).x = ag(0).x-32
                ag(blkID).y = ag(0).y
            end if
            if ag(0).d = 2 and world(ag(0).x\TILEW+1,ag(0).y\TILEH)<>0 then 'moving right
                world(ag(0).x\TILEW+1,ag(0).y\TILEH)=0
                ag(blkID).dx = 1
                ag(blkID).dy = 0
                ag(blkID).a = 1
                ag(blkID).x = ag(0).x+32
                ag(blkID).y = ag(0).y
            end if
            if ag(0).d = 3 and world(ag(0).x\TILEW,ag(0).y\TILEH-1)<>0 then 'moving up
                world(ag(0).x\TILEW,ag(0).y\TILEH-1)=0
                ag(blkID).dy = -1
                ag(blkID).dx = 0
                ag(blkID).a = 1
                ag(blkID).x = ag(0).x
                ag(blkID).y = ag(0).y - 32
            end if
        end if        

    end if
    
    
end sub



dim as double now1
now1 = timer

update()

do
   
    if timer > now1 + 0.01 then
        now1 = timer
        update()
        drawWorld()
    end if
   
    sleep 2

loop until multikey(&H01)

data 0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,1,1,1,1,0,0,1,0
data 0,1,0,1,0,1,0,1,0,1,0,0,0
data 1,2,0,2,0,0,0,0,0,1,0,2,0
data 1,0,0,0,0,0,0,0,0,1,0,1,0
data 0,0,1,0,0,0,1,1,0,1,0,1,0
data 1,0,0,0,0,0,0,0,0,1,0,1,0
data 1,1,1,0,1,1,0,1,1,1,0,1,0
data 0,0,0,0,0,0,0,1,0,1,0,0,0
data 0,0,0,0,1,1,0,0,0,0,0,1,1
data 0,0,0,0,0,1,0,0,0,0,0,0,0
data 0,1,0,0,0,1,0,1,0,0,0,0,0
data 0,1,0,0,0,0,0,0,1,1,0,1,0
data 0,0,0,0,0,0,0,0,0,0,0,1,0
data 0,1,0,0,0,0,0,0,0,1,0,1,0

Last edited by BasicCoder2 on Mar 16, 2017 8:08, edited 1 time in total.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

they do collide with player.... BUT only if the player is not perfectly on the tile.... the problem is in the collision check somehow... just an idea...

it took a while testing to get them to collide, but you can see the other agents changing direction without hitting anything else bu agent, unless agent is perfectly in his square... but it only happens sometimes... can't figure out the pattern yet, but, am getting sick of chasing around these dudes trying to collide with them! - gonna make agent twice as fast i think! lol
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

fixed the colliding issue... but now something whacked about the determination of facing... argh! The colliding issue problem was that you never set the Player's agent variable up - his w and h were still 0, not 32

Since I made the player twice as fast, it makes you want to 'push' the other agents either out of the way or in the direction you are heading... just like overly slow drivers of cars...

ok, figured out facing issue... here is code

Code: Select all

const WORLDW = 20
const WORLDH = 15

type AGENT
    as integer x         'current position
    as integer y
    as integer w
    as integer h
    as integer dx        'velocity between -1 and +1
    as integer dy
    as integer d         'direction
    as integer f         'frame
    as integer ID
end type


dim shared as integer count

const TILEW = 32
const TILEH = 32

const SCRW = WORLDW*TILEW
const SCRH = WORLDH*TILEH

dim shared as integer WINX,WINY,WINW,WINH


screenres SCRW, SCRH, 32
color rgb(0,0,0),rgb(255,255,255):cls

dim shared as AGENT ag(0 to 4)

for i as integer = 1 to 4  'skip player ag(0)
    ag(i).w = 32
    ag(i).h = 32
    ag(i).y = 0
    ag(i).x = i*TILEW*2+100
    ag(i).id = i
    ag(i).dx = int(rnd(1)*3)-1
    ag(i).dy = int(rnd(1)*3)-1
    while ag(i).dx = 0 and ag(i).dy=0
        ag(i).dx = int(rnd(1)*3)-1
        ag(i).dy = int(rnd(1)*3)-1
    wend
next i
    ag(0).id = 0
    ag(0).w = 32
    ag(0).h = 32
    
dim shared as any ptr imgBlock
imgBlock = imagecreate(96,128)
bload "agent.bmp",imgBlock

dim shared as integer world(WORLDW,WORLDH)
'fill with random non walkable tiles
for j as integer = 2 to WORLDH-1
    for i as integer = 0 to WORLDW-1
        if int(rnd(1)*10)=0 then
            world(i,j)=1
        end if
    next i
next j

function testCollision(b1 as AGENT,b2 as AGENT) as boolean
    return b2.y < (b1.y + b1.h) and (b2.y + b2.h) > b1.y and b2.x < (b1.x + b1.w) and (b2.x + b2.w) > b1.x
end function

sub drawWorld()
    screenlock
    cls
    'draw tiles
    for j as integer = 0 to  WORLDH-1
        for i as integer = 0 to WORLDW-1
            if world(i,j)<>1 then
                line (i*TILEW,j*TILEH)-(i*TILEW+TILEW,j*TILEH+TILEH),rgb(0,0,0),b
            else
                line (i*TILEW,j*TILEH)-(i*TILEW+TILEW,j*TILEH+TILEH),rgb(100,100,200),bf
            end if
        next i
    next j
   
    'draw agents
    for i as integer = 0 to 4
        if ag(i).dx = 0 and ag(i).dy = 0 then ag(i).f = 1
        draw string (ag(i).x,ag(i).y),str(i)
        put (ag(i).x,ag(i).y),imgBlock,(ag(i).f*32,ag(i).d*32)-(ag(i).f*32+31,ag(i).d*32+31),trans
    next i
    screenunlock
end sub

sub moveAgent(agent as AGENT)
        dim as integer hit
        dim as integer TILEX,TILEY
       
        hit = 0
        'move agent
        agent.x = agent.x + agent.dx
        agent.y = agent.y + agent.dy
       
        'out of bounds
        if agent.x < 0 or agent.x > SCRW-TILEW or agent.y < 0 or agent.y > SCRH-TILEH then hit = 1

        'test overlap of another tile
        TILEX = int(agent.x/TILEW)
        TILEY = int(agent.y/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1

        TILEX = int((agent.x+TILEW-1)/TILEW)
        TILEY = int((agent.y)/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1

        TILEX = int((agent.x)/TILEW)
        TILEY = int((agent.y+TILEH-1)/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1

        TILEX = int((agent.x+TILEW-1)/TILEW)
        TILEY = int((agent.y+TILEH-1)/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1
       
        'test for sprite to sprite collision
        for j as integer = 0 to 4
            if agent.ID <> ag(j).ID then  'not with itself
                if testCollision(agent,ag(j)) then
                    hit = 1
                end if
            end if
        next j

        if hit = 1 then

            agent.x = agent.x - agent.dx 'undo move
            agent.y = agent.y - agent.dy
           
            if agent.id <> 0 then 'not player controlled make random change
            'new trial direction

                agent.dx = int(rnd(1)*3)-1
                agent.dy = int(rnd(1)*3)-1
                while (agent.dx and agent.dy) or (agent.dx=0 and agent.dy=0)
                    agent.dx = int(rnd(1)*3)-1
                    agent.dy = int(rnd(1)*3)-1 
                wend
                
            end if
        end if
end sub


sub update()
    'test if player sprite is center of tile before making any changes
    if ag(0).x = int(ag(0).x\TILEW)*TILEW and ag(0).y = int(ag(0).y\TILEH)*TILEH then
        'stop in center of tile only move on if key is pressed
        ag(0).dx = 0
        ag(0).dy = 0
        'only one of four directions possible
        If MultiKey(&H4B) then ag(0).dx = -2:ag(0).dy = 0
        If MultiKey(&H4D) then ag(0).dx =  2:ag(0).dy = 0
        If MultiKey(&H48) then ag(0).dy = -2:ag(0).dx = 0
        If MultiKey(&H50) then ag(0).dy =  2:ag(0).dx = 0
    end if

    for i as integer = 0 to 4
        'set image direction value
        If ag(i).dx < 0 then ag(i).d = 1
        If ag(i).dx > 0 then ag(i).d = 2
        If ag(i).dy < 0 then ag(i).d = 3
        If ag(i).dy > 0 then ag(i).d = 0 
   
        moveAgent(ag(i))
    next i
   
    'update the frame rate
    count = count + 1
    if count = 20 then
        count = 0
        for i as integer = 0 to 4
            ag(i).f = ag(i).f + 1
            if ag(i).f = 3 then ag(i).f = 0
        next i
    end if

    drawWorld()
end sub


dim as double now1
now1 = timer

do
   
    if timer > now1 + 0.01 then
        now1 = timer
        update()
    end if
   
    sleep 2

loop until multikey(&H01)
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

kinda reminds me of a game I used to play as a kid in the arcade called Pengo - you were a penguin who pushed blocks around, trying to squish monsters and also to get a certain number of 'special' blocks in a line...

https://www.youtube.com/watch?v=0hdDKxfrAbs

lol! i forgot the theme song was 'popcorn', (i think)... they must have licensed it...i wonder
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Simple Game framework

Post by BasicCoder2 »

leopardpm wrote:ok, figured out facing issue... here is code
Thank you for your input. I was curious how hard it would be to make a similar game engine as the one used by RPG Maker. It is only the first draft :)
The RPG Maker engine also waits until the player sprite is centered before the keys can take affect. It make it easy to move about without having to center it yourself to get between two obstacles thus giving the game a more pleasurable experience.
Although it may be a simple engine it can be used to test all the logic of simulations that use the isometric displays without having to wait for all the heavy duty graphics to be completed.

Pengo block pushing reminds me of an earlier foray into tinkering with game logic.
http://www.freebasic.net/forum/viewtopi ... 15&t=21813
Being able to quickly write a version of Pengo would show just how well you have a handle on the game writing business.
.
Last edited by BasicCoder2 on Mar 04, 2017 5:40, edited 1 time in total.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

Pengo block pushing reminds me of an earlier foray into tinkering with game logic.
viewtopic.php?f=15&t=21813
luv it! Good job, especially in a whole 220 lines of code!
write a version of Pengo
that could be fun, it is simple enough in all aspects to not be out of my basic programming ability...
...would show just how well you have a handle on the game writing business.
probably not so much... still would be fun tho
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Simple Game framework

Post by BasicCoder2 »

Well how quickly could you write a game like Pengo. I don't really like duplicating a game but duplicating the complexity with a similar game I think is ok. The whole idea of using RGB Maker is that you can get a game up and running very quickly once you have mastered the use of RGB Maker.
In the next example I have simply changed the size of the world, added another type of tile, and given each agent a ptr to some sprite image of which I have added two.
Run this to generate one of the images,

Code: Select all

screenres 640,480,32
dim as any ptr image
image = imagecreate( 96, 128)
dim as ulong colors( 5)
colors( 0)=RGB(255,0,255)
colors( 1)=RGB(0,0,0)
colors( 2)=RGB(181,230,29)
colors( 3)=RGB(255,0,0)
colors( 4)=RGB(34,177,76)
    dim as integer n
    for j as integer = 0 to  127
        for i as integer = 0 to  95
            read n
            pset image,(i,j),colors(n)
        next i
    next j
bsave "greenBlob1.bmp",image

DATA  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0
DATA  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
The next post will contain the second image and the third post the program that uses them.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Simple Game framework

Post by BasicCoder2 »

The second image.

Code: Select all

screenres 640,480,32
dim as any ptr image
image = imagecreate( 96, 128)
dim as ulong colors( 6)
colors( 0)=RGB(255,0,255)
colors( 1)=RGB(0,0,0)
colors( 2)=RGB(63,72,204)
colors( 3)=RGB(255,242,0)
colors( 4)=RGB(255,127,39)
colors( 5)=RGB(34,177,76)
    dim as integer n
    for j as integer = 0 to  127
        for i as integer = 0 to  95
            read n
            pset image,(i,j),colors(n)
        next i
    next j
bsave "redPenguin1.bmp",image

DATA  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Simple Game framework

Post by BasicCoder2 »

And the demo that uses the two images.

Code: Select all

const WORLDW = 13
const WORLDH = 15

type AGENT
    as integer x         'current position
    as integer y
    as integer w
    as integer h
    as integer dx        'velocity between -1 and +1
    as integer dy
    as integer d         'direction
    as integer f         'frame
    as integer ID
    as any ptr img       'sprite image block
end type

dim shared as integer count

const TILEW = 32
const TILEH = 32

const SCRW = WORLDW*TILEW
const SCRH = WORLDH*TILEH

dim shared as integer WINX,WINY,WINW,WINH

screenres SCRW, SCRH, 32
color rgb(0,0,0),rgb(255,255,255):cls
dim shared as any ptr greenBlob
greenBlob = imagecreate(96,128)
bload "greenBlob1.bmp",greenBlob

dim shared as any ptr redPenguin
redPenguin = imagecreate(96,128)
bload "redPenguin1.bmp",redPenguin

dim shared as AGENT ag(0 to 4)

for i as integer = 1 to 4  'skip player ag(0)
    ag(i).w = 32
    ag(i).h = 32
    ag(i).y = 0
    ag(i).x = i*TILEW*2+100
    ag(i).id = i
    ag(i).dx = int(rnd(1)*3)-1
    ag(i).dy = int(rnd(1)*3)-1
    while ag(i).dx = 0 and ag(i).dy=0
        ag(i).dx = int(rnd(1)*3)-1
        ag(i).dy = int(rnd(1)*3)-1
    wend
    ag(i).img = greenBlob
next i

ag(0).id = 0
ag(0).w = 32
ag(0).h = 32
ag(0).img = redPenguin


dim shared as integer world(WORLDW,WORLDH)
for j as integer = 0 to WORLDH-1
    for i as integer = 0 to WORLDW-1
        read world(i,j)
    next i
next j

function testCollision(b1 as AGENT,b2 as AGENT) as boolean
    return b2.y < (b1.y + b1.h) and (b2.y + b2.h) > b1.y and b2.x < (b1.x + b1.w) and (b2.x + b2.w) > b1.x
end function

sub drawWorld()
    screenlock
    cls
    'draw tiles
    for j as integer = 0 to  WORLDH-1
        for i as integer = 0 to WORLDW-1
            if world(i,j)=1 then
                line (i*TILEW,j*TILEH)-(i*TILEW+TILEW,j*TILEH+TILEH),rgb(100,100,200),bf
            end if
            if world(i,j)=2 then
                line (i*TILEW,j*TILEH)-(i*TILEW+TILEW,j*TILEH+TILEH),rgb(200,100,100),bf
            end if
        next i
    next j
   
    'draw blobs
    for i as integer = 0 to 4
        if ag(i).dx = 0 and ag(i).dy = 0 then ag(i).f = 1
        draw string (ag(i).x,ag(i).y),str(i)
        if i=0 then
            put (ag(i).x,ag(i).y),redPenguin,(ag(i).f*32,ag(i).d*32)-(ag(i).f*32+31,ag(i).d*32+31),trans
        else
            put (ag(i).x,ag(i).y),greenBlob,(ag(i).f*32,ag(i).d*32)-(ag(i).f*32+31,ag(i).d*32+31),trans
        end if
    next i
    

    screenunlock
end sub

sub moveAgent(agent as AGENT)
        dim as integer hit
        dim as integer TILEX,TILEY
       
        hit = 0
        'move agent
        agent.x = agent.x + agent.dx
        agent.y = agent.y + agent.dy
       
        'out of bounds
        if agent.x < 0 or agent.x > SCRW-TILEW or agent.y < 0 or agent.y > SCRH-TILEH then hit = 1

        'test overlap of another tile
        TILEX = int(agent.x/TILEW)
        TILEY = int(agent.y/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1

        TILEX = int((agent.x+TILEW-1)/TILEW)
        TILEY = int((agent.y)/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1

        TILEX = int((agent.x)/TILEW)
        TILEY = int((agent.y+TILEH-1)/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1

        TILEX = int((agent.x+TILEW-1)/TILEW)
        TILEY = int((agent.y+TILEH-1)/TILEH)
        if world(TILEX,TILEY)<>0 then hit = 1
       
        'test for sprite to sprite collision
        for j as integer = 0 to 4
            if agent.ID <> ag(j).ID then  'not with itself
                if testCollision(agent,ag(j)) then
                    hit = 1
                end if
            end if
        next j

        if hit = 1 then

            agent.x = agent.x - agent.dx 'undo move
            agent.y = agent.y - agent.dy
           
            if agent.id <> 0 then 'not player controlled make random change
            'new trial direction

                agent.dx = int(rnd(1)*3)-1
                agent.dy = int(rnd(1)*3)-1
                while (agent.dx and agent.dy) or (agent.dx=0 and agent.dy=0)
                    agent.dx = int(rnd(1)*3)-1
                    agent.dy = int(rnd(1)*3)-1 
                wend
                
            end if
        end if
end sub


sub update()
    'test if player sprite is center of tile before making any changes
    if ag(0).x = int(ag(0).x\TILEW)*TILEW and ag(0).y = int(ag(0).y\TILEH)*TILEH then
        'stop in center of tile only move on if key is pressed
        ag(0).dx = 0
        ag(0).dy = 0
        'only one of four directions possible
        If MultiKey(&H4B) then ag(0).dx = -2:ag(0).dy = 0
        If MultiKey(&H4D) then ag(0).dx =  2:ag(0).dy = 0
        If MultiKey(&H48) then ag(0).dy = -2:ag(0).dx = 0
        If MultiKey(&H50) then ag(0).dy =  2:ag(0).dx = 0
    end if

    for i as integer = 0 to 4
        'set image direction value
        If ag(i).dx < 0 then ag(i).d = 1
        If ag(i).dx > 0 then ag(i).d = 2
        If ag(i).dy < 0 then ag(i).d = 3
        If ag(i).dy > 0 then ag(i).d = 0 
   
        moveAgent(ag(i))
    next i
   
    'update the frame rate
    count = count + 1
    if count = 10 then
        count = 0
        for i as integer = 0 to 4
            ag(i).f = ag(i).f + 1
            if ag(i).f = 3 then ag(i).f = 0
        next i
    end if

    drawWorld()
end sub


dim as double now1
now1 = timer

do
   
    if timer > now1 + 0.01 then
        now1 = timer
        update()
    end if
   
    sleep 2

loop until multikey(&H01)

data 0,1,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,1,1,1,1,1,1,0,0,1,0
data 0,1,0,1,0,1,0,1,0,1,0,0,0
data 1,2,0,2,0,0,0,0,0,1,0,2,0
data 1,0,0,0,0,0,0,0,0,1,0,1,0
data 0,0,1,0,0,0,1,1,0,1,0,1,0
data 1,0,0,0,0,0,0,0,0,1,0,1,0
data 1,1,1,0,1,1,0,1,1,1,0,1,0
data 0,0,0,0,0,0,0,1,0,1,0,0,0
data 0,0,0,0,1,1,0,0,0,0,0,1,1
data 0,0,0,0,0,1,0,0,0,0,0,0,0
data 0,1,0,0,0,1,0,1,0,0,0,0,0
data 0,1,0,0,0,0,0,0,1,1,0,1,0
data 0,0,0,0,0,0,0,0,0,0,0,1,0
data 0,1,0,0,0,0,0,0,0,1,0,1,0
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

lol - there has to be a better way to transfer images between us... lol - it works though, just seems so darned clunky!

is there a program part coming? oops, i spoke too soon! will test now...

Looks and works pretty darned good!

all that is needed is ability to slide blocks, taking into account the special blocks, being able to have a sliding block kill a blob, a 'winning' condition - or two, a scoring system including managing 'high' scores, and bingo...

I notice in the original Pengo the 'blobs' move randomly, but will 'tend' towards the player... I figure a 25-50% chance at every intersection that it will pick the direction towards the player, else it chooses randomly between the other directions...

Do you really want to finish this game? or for me to do it?

It is almost fun to play as is... except all I can figure out to do is to 'trap' the blobs in a single square by blocking their one exit with the penguin... makes the blobs go 'crazy'...
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

How about this idea... perhaps this would be a good, simple, game to collaborate on - perhaps start with the good code you already have, divide up the remaining routines that need done (the list in last post is maybe a good start), and in completing the game it would also perhaps help both of us understand something that I am totally unfamiliar with - programming with multiple coders... I never have used things like GitHub and such, but I feel like it could be invaluable in bigger projects with multiple people coding on the same project... not saying that we would use GitHub, but if you know how to use it then I would love to learn!

.. or, could just finish the game off individually - it is simple enough, yet still would provide challenges as I haven't ever 'completed' a finished game, even a simple one like this - so there would be things learned from doing so.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

actually, what is currently appealing to me is optimizing and refining your method of image transfer through the forum posts.

I think you wrote a routine that loads up any image, scans it, and writes the resulting DATA statements to a text file - am I correct?

Does it also generate the code for the Indexed colors? How many colors will it handle, 256?
I gather it does not handle images above a certain size, right? Because it puts an entire row of pixels in each DATA statement?

I know that your current way works fine, and we would gain absolutely no benefit from this idea... but I figure that we can greatly shorten the number of data statements by utilizing more of the ascii character set and making strings instead of numbers separated by commas, in addition, making it so that it can handle any size image, not limited to the number of max characters in a line statement in the editor used...

so, basically, we can easily use 7 bits of the ascii code which will display and be able to be 'copied and pasted' in the same manner your data statement programs are. A simple version could just limit the number of indexed colors to 128 so that each character in the data string would be a full index to the color of the point. Kinda limiting, especially considering the BMP format is a full 32bits (8 of which are Alpha, which is nice) - but still very useful. Another thing is to incorporate a basic RLE compression so that lengths of the same color pixels can be represented just by saying "15 pixels of Red", instead of "RED,RED,RED,RED...etc"

the resulting DATA statements will be cryptic though, and basically unmodifiable, unlike your method where one can easily change the graphic made by easily modifying the data statements. Here is an example of what this compressed, RLE graphic DATA statement might look like:

Code: Select all

DATA ")SäJÆNRUç#&*%#ò19573nsdiUJSUusd823&*^@3$89!(&@*#fsdsf"
after I get this outta my head then maybe I can focus on "FBPengo, The Most Excellent FreeBasic Game"
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

Quick question, BC - Do you handdraw each frame of these penguins, then copy/paste them into one spritesheet? or do you use a sprite making program which allows you to see the animation as you draw and makes the spritesheet for you?

I was just using your penguin sprite for testing purposes and the question occurred to me...
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

making slow progress... so far it analyzes image and prepares for RLE but doesn't yet actually encode RLE yet.... here is text file output from your red Penguin image... still editable as it is, but getting weird looking:

Code: Select all

96,128
7
"2F00FF00"
"FFFF00FF"
"FF000000"
"FF3F48CC"
"FFFFF200"
"FFFF7F27"
"FF22B14C"
"#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$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&&&%))%$$$$$"
"$$$$$$%%%&&&&&&&&&&&&&&&%%%$$$$$$$$$$$$%))%&&&&&&&&&&&&&&%$$$$$$$$$$$$$$%&&&&&&&&&&&&&&%))%$$$$$"
"$$$$$$$%%&&&&&&&&&&&&&&&%%$$$$$$$$$$$$$$%)%&&&&&&&&&&&&&&%$$$$$$$$$$$$$$%&&&&&&&&&&&&&&%)%$$$$$$"
"$$$$$$$%%&&&&&&&&&&&&&&&%%$$$$$$$$$$$$$$$%%%%&&&&&&&&&&&&%$$$$$$$$$$$$$$%&&&&&&&&&&&&%%%%$$$$$$$"
"$$$$$$$$%&&&&&&&&&&&&&&&%$$$$$$$$$$$$$$$$%((%&&&&&&&&&&&&%$$$$$$$$$$$$$$%&&&&&&&&&&&&%((%$$$$$$$"
"$$$$$$$$$%&%&&&&&&&&&&&%$$$$$$$$$$$$$$$$%((((%%&&&&&&&&&&%$$$$$$$$$$$$$$%&&&&&&&&&&%%((((%$$$$$$"
"$$$$$$$$$%%((%%&&&%%((%%$$$$$$$$$$$$$$$$$%((((%&&&&&&&&&%$$$$$$$$$$$$$$$$%&&&&&&&&&%((((%$$$$$$$"
"$$$$$$$$$%((((%%%%%((((%$$$$$$$$$$$$$$$$$%((((%%%&&&&&&&%$$$$$$$$$$$$$$$$%&&&&&&&%%%((((%$$$$$$$"
"$$$$$$$$$%((((%$$$%((((%$$$$$$$$$$$$$$$$$$%((((%%%%%%%%%$$$$$$$$$$$$$$$$$$%%%%%%%%%((((%$$$$$$$$"
"$$$$$$$$$%%%%%$$$$$%%%%%$$$$$$$$$$$$$$$$$$%%%%%%$$$$%%%%$$$$$$$$$$$$$$$$$$%%%%$$$$%%%%%%$$$$$$$$"
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"

but, already, it is in a much more compact form than having numbers separated by commas... currently it is limited to putting entire row of pixels in one data statement... oh well...

EDIT: added image header info and color table to data file, also posted the code so far if anyone cares for it... still waaaay 'in progress!

Code: Select all



#include once "fbgfx.bi"

#if __FB_LANG__ = "fb"
Using FB '' Scan code constants are stored in the FB namespace in lang FB
#endif

#if __FB_LANG__ = "qb"
#define EXTCHAR Chr$(0)
#else
#define EXTCHAR Chr(255)
#endif

#define RGBA_R( c ) ( CUInt( c ) Shr 16 And 255 )
#define RGBA_G( c ) ( CUInt( c ) Shr  8 And 255 )
#define RGBA_B( c ) ( CUInt( c )        And 255 )
#define RGBA_A( c ) ( CUInt( c ) Shr 24         )

Const NULL As Any Ptr = 0
Const ConvertMagicPink as integer = 0 ' 0 = no, 1 = yes

    dim shared As any ptr CurrentImage
    dim shared as string filename, file1, file2
    dim As Integer Image_Width, Image_Height, Image_Pitch, ibypp, isize
    dim Image_Pixels As Any ptr
    
    dim as integer NumOfColors
    dim as ulong colors(10000)
    dim as ulong PixelColor
    
    dim shared as ubyte Convert1(16777216,1)  ' max size = 4096x4096

    dim shared as string datastring(4096)

'====================================================  Load BMP Routine
Function bmp_load( ByRef filename As Const String ) As Any Ptr

    Dim As Integer filenum, bmpwidth, bmpheight
    Dim As Any Ptr img

                  '' open BMP file
    filenum = FreeFile()
    If Open( filename For Binary Access Read As #filenum ) <> 0 Then Return NULL
                  '' retrieve BMP dimensions
    Get #filenum, 19, bmpwidth
    Get #filenum, 23, bmpheight
    Close #filenum
                  '' create image with BMP dimensions
    img = ImageCreate( bmpwidth, Abs(bmpheight) )
    If img = NULL Then Return NULL
                  '' load BMP file into image buffer
    If BLoad( filename, img ) <> 0 Then ImageDestroy( img ): Return NULL
    Return img
End Function
'====================================================

    screenres 640,480,32

    file1 = "redPenguin1" : file2 = ".bmpx" : filename = file1 + file2
    CurrentImage = bmp_load(filename)
    if CurrentImage = NULL then beep
    
    ' get the info from the image
    If 0 <> imageinfo(CurrentImage, Image_Width, Image_Height, ibypp, Image_Pitch, Image_Pixels,isize) Then _
            Print "unable to retrieve image information." : beep : Sleep : End

    cls
    'make screen big gray box
    line(0,0)-(639,479), rgb(32,32,32),BF
    put (100,100),CurrentImage, pset
    put (300,100),CurrentImage, trans
    locate 2,2 : print using "Image Size is (### x ###)";Image_Width; Image_Height

    
    'for y = 0 to Image_Height - 1
        'for x = 0 to Image_Width - 1
            PixelColor = point(0,0,CurrentImage)
            locate 4,2 : print using "Color (r### , g### , b### , a###)";RGBA_R(PixelColor);RGBA_G(PixelColor);RGBA_B(PixelColor);RGBA_A(PixelColor);

' analyze Image
    NumOfColors = 0
    dim as integer CurPixelNumber = 0
    
    for y as integer = 0 to Image_Height - 1
        for x as integer = 0 to Image_Width - 1
            PixelColor = point(x,y,CurrentImage)
            ' is it already in table?
            dim as integer IsInTable = 0
            if NumOfColors > 0 then
                for c as integer = 1 to NumOfColors
                    if Colors(c) = PixelColor then IsInTable = c
                next c
            end if
            if IsInTable = 0 then
                NumOfColors += 1
                Colors(NumOfColors) = PixelColor
                IsInTable = NumOfColors
            end if
            ' IsInTable = index to color of PixelColor
            datastring(y) = datastring(y) + chr(34+IsInTable)
            
            '
            ' Now add it to the Convert1 array
            ' Convert1(c,0) = color index
            ' Convert1(c,1) = number of pixels in a row same color
            '
            if Convert1(CurPixelNumber,0) = IsInTable and CurPixelNumber > 1 then
                ' if same color as the last pixel then inc num of pixels of that color... for RLE
                Convert1(CurPixelNumber,1) += 1
            else
                ' this pixel is different color from the previous one...
                CurPixelNumber += 1
                Convert1(CurPixelNumber,1) = 1
                Convert1(CurPixelNumber,0) = IsInTable
            end if
        next x
    next y
    
    ' now take the Convert1 array and make it into strings with RLE
    ' RLE starts with special character 32 (space) and is encoded: <space><pixelcolor><repetitions> with each being 1 character or byte
    '
'    for c as integer = 1 to CurPixelNumber
'        ' is it REL?
'        if Convert1(c,1) > 3 then
'            ' put in string <space><pixelcolor><repetitions>
'        else
'            ' put the 1 to 3 same color pixels
'            for c1 as integer = 1 to Convert1(c,1)
'                ' add Convert1(c,0) to string
'            next c1
'        end if
'    next c
'   


    
    locate 6,2 : print using "Colors (####)";NumOfColors;

' for testing output as we go so far...
filename = file1 + ".txt"
Open filename For Output As #1
    write #1, Image_Width, Image_Height
    write #1, NumOfColors
    for c as integer = 1 to NumOfColors
        write #1, hex(Colors(c))
    next c
    
    for row as integer = 0 to Image_Height - 1
        Write #1, datastring(row)
    next row
Close #1

    sleep
    end
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Simple Game framework

Post by leopardpm »

ok, think I got the RLE working as well as DATA lines not limited to same number of pixels as width.... will now have to make a 'decoder' to see if all is well, then make it robust and fill out its capabilities - right now it is limited to RLE of only 127 of same color pixels, and right now I limited the max characters in the string of each DATA line to 80 chars, and I think there are other limitations...

IF it is working correctly, then the following compressed data of only 52 lines of about 80 characters each (about 4160 characters total) contains the same info that it took 128 lines of 192 characters (about 24,576 characters total, which is already almost 1/2 the allowed forum post size of 60,000!)

AH HA! I discovered the reason to use this method - the forum post limit size! If we are transferring anything much more than a simple 4 direction character with a few frames animation, then the forum limit will be reached and it will be additional pain to copy/paste between multiple posts to get the final complete file... using the above compression ratio, this new way allows 5 or 6 times the image size to fit into a forum post...


here is the OUTPUT data file, RLE style....
(NOTE: everywhere you see a <space>, that means that the next two characters define something encoded RLE: <color><run length>

Code: Select all

96,128
7
"2F00FF00"
"FFFF00FF"
"FF000000"
"FF3F48CC"
"FFFFF200"
"FFFF7F27"
"FF22B14C"
"# $¢ $l %+ $x% &+% $7 %+ $9 %+ $8 %'&&& %' $5% &+% $7% &+% $6%%''%'%&%'%''%% $3%&"
" %&&&& %& $5 %&&&& %&&% $4%&%''%'%&%'%''%&% $1%&%''%'%&%'%''% $3%''%'%&%'%''%&% $3"
"%&& '&%&% '&%&% $0%&&%''%'%&%'%''%% $1%%''%'%&%'%''%&&% $2%&& %&&&& %&&&% $0%&&% '&"
"%&% '&%% $1%% '&%&% '&%&&% $2% &' %' &'% $0%&&& %&&&& %&&% $1%& %&&&& %&&&&% $2% &&"
"% ('% &&% $0% &( %' &&% $1% && %' &(% $2%&&&%((%%%((%&&&% $0% &'% ('%&&&% $1%&&&%"
" ('% &'% $2%&&&%% ('%%&&&% $0% &&%((%%%((%&&% $1%&&%((%%%((% &&% $1%% && %) &&%% $/"
"% &&%% ('%%&&% $1%&&%% ('%% &&% $0%))% &/%))% $.% &' %)&&&%% $/%%&&& %) &'% $0%))"
"% &/%))% $.%%% &/%% $/%% &/%%% $0%))% &/%))% $-%)))% &-%)% $/%)% &-%)))% $0%)% &/"
"%)% $.%)))% &-%))% $-%))% &-%)))% $0%)% &/%)% $.% )&% &+%%))% $-%))%% &+% )&% $0%"
")% &/%)% $/%)))% &+%%))% $-%))%% &+%)))% $1%))% &-%))% $/%)))% &+%)))% $-%)))% &+"
"%)))% $1%)))% &+%)))% $/% )&% &*%%)%% $-%%)%% &*% )&% $1%)))% &+%)))% $/%% )&% &*"
" %& $- %& &*% )&%% $2 %& &+ %& $0%%%)))% &+%%% $-%%% &+%)))%%% $3% &/% $1 %) &+% $1"
"% &+ %) $3%&%% &)%%&% $1%(((%%% &*% $3% &*%%%(((% $4%(( %)((% $1% ((% &*% $3% &*%"
" ((% $2% (&%$$$% (&% $0% () %+ $3 %+ ()% $1% ('%$$$% ('% $0% ((%$$$%%((% $3%((%%$$$"
"% ((% $3%%((% $'%((%% $1%% ('%$$%(((% $5%(((%$$% ('%% $5%% $)%% $5 %' $& %& $5 %&"
" $& %' $¢ $¢ $Y %+ $x% &+% $v%&&& %& &&% $7 %+ $7 %+ $9%&&%'%''% &&% $5% &+% $5% &+"
"% $7%&&&%'%''% &'% $3%&&& %& &&% $3%&&& %& &&% $6%&&&% '&% &'% $3%&&%'%''% &&% $2"
"%&&%'%''% &&% $5% && %& &(% $2%&&&%'%''% &'% $0%&&&%'%''% &'% $3 %& &.% $2%&&&% '&"
"% &'% $0%&&&% '&% &'% $2% (&% &-% $2% && %& &(% $0% && %& &(% $1% ('% &-% $1 %& &."
"% $/ %& &.% $0% ('% &.% $0% (&% &-% $.% (&% &-% $1 %( &.% $/% ('% &-% $-% ('% &-%"
" $3% &(%%% &(% $.% ('% &.% $,% ('% &.% $3% &'%)))% &'% $/ %( &.% $- %( &.% $3% &'"
"%)))% &'% $1% &)%%% &'% $/% &)%%% &'% $3% &'% )&% &&% $1% &(%)))% &&% $/% &(%)))%"
" &&% $3% &(%)))% &&% $1% &(% )&%&&&% $/% &'% )&% &&% $3% &(%)))% &&% $1% &(% )'%&&"
"% $/% &&% )'% &&% $3% &(%)))% &&% $1% &)% )'%&% $/%&&&% )'% &'% $3% &(% )&%&&&% $1"
"% &*% )'%% $/%&%% )'% &(% $3% &(%% )&%&&% $1% &+% )(% $.%% )(% &)% $3% &)%%)))%&&"
"% $1% &,%% )&% $, %& )&%% &*% $4% &) %'&% $/%$$% &. %& $,%((%& %& &,% $4% &/% $.%"
"(%%% &1% $,%(((% &0% $5 %/ $/%(((%% &.%%(% $+% (&%% &-%% $5%(( %( $3% (&% &,%% (&"
"% $*% ('% &,%((% $3%((% ('% $4% (& %, ('%% $+% (' %, (&% $3%% ()% $3% (&% $*%(((%%"
" $.% (&% $)% ('% $5 %* $4 %' $* %& $1 %& $+ %' $¢ $¢ $U %+ $x% &+% $v% && %&&&&% $7"
" %+ $; %+ $4% &&%''%'%&&% $6% &+% $9% &+% $2% &'%''%'%&&&% $4% && %&&&&% $7% && %&"
"&&&% $1% &'% '&%&&&% $3% &&%''%'%&&% $6% &&%''%'%&&% $1% &( %& &&% $2% &'%''%'%&&&"
"% $4% &'%''%'%&&&% $0% &. %& $1% &'% '&%&&&% $4% &'% '&%&&&% $0% &-% (&% $0% &( %&"
" &&% $4% &( %& &&% $0% &-% ('% $/% &. %& $3% &. %& $/% &.% ('% $.% &-% (&% $2% &-"
"% (&% $.% &. %( $/% &-% ('% $1% &-% ('% $-% &(%%% &(% $1% &.% ('% $0% &.% ('% $,%"
" &'%)))% &'% $1% &. %( $1% &. %( $-% &'%)))% &'% $1% &'%%% &)% $3% &'%%% &)% $/% &&"
"% )&% &'% $1% &&%)))% &(% $3% &&%)))% &(% $/% &&%)))% &(% $1%&&&% )&% &(% $3% &&%"
" )&% &'% $/% &&%)))% &(% $1%&&% )'% &(% $3% &&% )'% &&% $/% &&%)))% &(% $1%&% )'%"
" &)% $3% &'% )'%&&&% $/%&&&% )&% &(% $1%% )'% &*% $3% &(% )'%%&% $/%&&% )&%% &(% $0"
"% )(% &+% $3% &)% )(%% $/%&&%)))%% &)% $0% )&%% &,% $3% &*%% )& %& $.%& %' &)% $2"
" %& &.%$$% $0% &, %&&%((% $-% &/% $2% &1%%%(% $/% &0%(((% $. %/ $2%(%% &.%%(((% $/"
"%% &-%% (&% $2 %(((% $1% (&%% &,% (&% $.%((% &,% ('% $2% ('%((% $0%% (' %, (&% $."
"% (& %, ('% $2% ()%% $3%%(((% $*% (&% $.% ('% $)% (&% $3 %* $7 %& $* %' $0 %' $+ %&"
" $¢ $¢ $¢ $” %+ $x% &+% $9 %+ $8 %+ $7% &-% $7% &+% $6% &+% $5% &/% $5% &-% $4% &-"
"% $3% &1% $3% &/% $2% &/% $2% &1% $2% &1% $0% &1% $1% &1% $2% &1% $0% &1% $1% &1%"
" $2% &1% $0% &1% $1% &1% $2% &1% $0% &1% $1% &1% $2% &1% $0% &1% $1% &1% $2% &1% $0"
"% &1% $1% &1% $2% &1% $0% &1% $0%% &1%% $1% &1% $0% &1% $/%)% &1%)% $/%% &1% $0% &1"
"%% $.%)% &1%)% $.%)% &1% $0% &1%)% $-%)% &1%)% $.%)% &1% $0% &1%)% $-%)% &1%)% $."
"%)% &1% $0% &1%)% $-%)% &1%)% $.%))% &0% $0% &0%))% $-%%% &1%%% $.%))% &0% $0% &0"
"%))% $.%% &1%% $0%)% &0% $0% &0%)% $/%% &1%% $1 %& &.% $0% &. %& $1% &1% $2%((% &."
"% $0% &.%((% $2%&% &-% $2% (&%% &,% $0% &,%% (&% $1%%((%%&&&%%((%% $3% (&% &+% $2"
"% &+% (&% $2% (& %' (&% $3% (&%%% &)% $2% &)%%% (&% $2% (&%$$$% (&% $4% (& %+ $4 %+"
" (&% $3 %' $' %' $4 %( $& %& $4 %& $& %( $Š"
and here is the code so far:

Code: Select all



#include once "fbgfx.bi"

#if __FB_LANG__ = "fb"
Using FB '' Scan code constants are stored in the FB namespace in lang FB
#endif

#if __FB_LANG__ = "qb"
#define EXTCHAR Chr$(0)
#else
#define EXTCHAR Chr(255)
#endif

#define RGBA_R( c ) ( CUInt( c ) Shr 16 And 255 )
#define RGBA_G( c ) ( CUInt( c ) Shr  8 And 255 )
#define RGBA_B( c ) ( CUInt( c )        And 255 )
#define RGBA_A( c ) ( CUInt( c ) Shr 24         )

Const NULL As Any Ptr = 0
Const ConvertMagicPink as integer = 0 ' 0 = no, 1 = yes

    dim shared As any ptr CurrentImage
    dim shared as string filename, file1, file2
    dim As Integer Image_Width, Image_Height, Image_Pitch, ibypp, isize
    dim Image_Pixels As Any ptr
    
    dim as integer NumOfColors
    dim as ulong colors(10000)
    dim as ulong PixelColor
    
    dim shared as ubyte Convert1(16777216,1)  ' max size = 4096x4096

    dim shared as string datastring(4096)

'====================================================  Load BMP Routine
Function bmp_load( ByRef filename As Const String ) As Any Ptr

    Dim As Integer filenum, bmpwidth, bmpheight
    Dim As Any Ptr img

                  '' open BMP file
    filenum = FreeFile()
    If Open( filename For Binary Access Read As #filenum ) <> 0 Then Return NULL
                  '' retrieve BMP dimensions
    Get #filenum, 19, bmpwidth
    Get #filenum, 23, bmpheight
    Close #filenum
                  '' create image with BMP dimensions
    img = ImageCreate( bmpwidth, Abs(bmpheight) )
    If img = NULL Then Return NULL
                  '' load BMP file into image buffer
    If BLoad( filename, img ) <> 0 Then ImageDestroy( img ): Return NULL
    Return img
End Function
'====================================================

    screenres 640,480,32

    file1 = "redPenguin1" : file2 = ".bmpx" : filename = file1 + file2
    CurrentImage = bmp_load(filename)
    if CurrentImage = NULL then beep
    
    ' get the info from the image
    If 0 <> imageinfo(CurrentImage, Image_Width, Image_Height, ibypp, Image_Pitch, Image_Pixels,isize) Then _
            Print "unable to retrieve image information." : beep : Sleep : End

    cls
    'make screen big gray box
    line(0,0)-(639,479), rgb(32,32,32),BF
    put (100,100),CurrentImage, pset
    put (300,100),CurrentImage, trans
    locate 2,2 : print using "Image Size is (### x ###)";Image_Width; Image_Height

    
    'for y = 0 to Image_Height - 1
        'for x = 0 to Image_Width - 1
            PixelColor = point(0,0,CurrentImage)
            locate 4,2 : print using "Color (r### , g### , b### , a###)";RGBA_R(PixelColor);RGBA_G(PixelColor);RGBA_B(PixelColor);RGBA_A(PixelColor);

' analyze Image
    NumOfColors = 0
    dim as integer CurPixelNumber = 0
    
    for y as integer = 0 to Image_Height - 1
        for x as integer = 0 to Image_Width - 1
            PixelColor = point(x,y,CurrentImage)
            ' is it already in table?
            dim as integer IsInTable = 0
            if NumOfColors > 0 then
                for c as integer = 1 to NumOfColors
                    if Colors(c) = PixelColor then IsInTable = c
                next c
            end if
            if IsInTable = 0 then
                NumOfColors += 1
                Colors(NumOfColors) = PixelColor
                IsInTable = NumOfColors
            end if
            ' IsInTable = index to color of PixelColor
            
            ' put in datastring as test only!
            'datastring(y) = datastring(y) + chr(34+IsInTable)
            
            '
            ' Now add it to the Convert1 array
            ' Convert1(c,0) = color index
            ' Convert1(c,1) = number of pixels in a row same color
            '
            if Convert1(CurPixelNumber,0) = IsInTable and CurPixelNumber > 1 and Convert1(CurPixelNumber,1) < 128 then
                ' if same color as the last pixel AND not the first pixel AND there are less than 128 pixels same color... then inc num of pixels of that color... for RLE
                Convert1(CurPixelNumber,1) += 1
            else
                ' this pixel is different color from the previous one...
                CurPixelNumber += 1
                Convert1(CurPixelNumber,1) = 1
                Convert1(CurPixelNumber,0) = IsInTable
            end if
        next x
    next y
    
    ' now take the Convert1 array and make it into strings with RLE
    ' RLE starts with special character 32 (space) and is encoded: <space><pixelcolor><repetitions> with each being 1 character or byte
    '
    dim as integer DataLineLength = 0, row1 = 1
    for c as integer = 1 to CurPixelNumber
        if DataLineLength > 80 then
            row1 += 1
            DataLineLength = 0
        end if
        
        ' is it RLE?
        if Convert1(c,1) > 3 then
            ' put in string <space><pixelcolor><repetitions>
            ' right now 'repetitions' is limited to the same 7 bit limitations as the Index color is...
            datastring(row1) = datastring(row1) + chr(32) + chr(34+ Convert1(c,0)) + chr(34+  Convert1(c,1))
            DataLineLength += 3
        else
            ' put the 1 to 3 same color pixels
            for c1 as integer = 1 to Convert1(c,1)
                ' add Convert1(c,0) to string
                datastring(row1) = datastring(row1) + chr(34+ Convert1(c,0))
                DataLineLength += 1
            next c1
        end if
    next c

    
   


    
    locate 6,2 : print using "Colors (####)";NumOfColors;

' for testing output as we go so far...
filename = file1 + ".txt"
Open filename For Output As #1
    write #1, Image_Width, Image_Height
    write #1, NumOfColors
    for c as integer = 1 to NumOfColors
        write #1, hex(Colors(c))
    next c
    
'    for row as integer = 0 to Image_Height - 1   'this was for non-RLE
'        Write #1, datastring(row)
'    next row

    for row as integer = 1 to row1  'this does correct # of Rows with RLE
        Write #1, datastring(row)
    next row

Close #1

    sleep
    end
Post Reply