Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ttemper

Pages: [1]
1
For the most part I have been learning FreeBasic... and enjoyed it thus far (even though it frustrated me to hell at times). With much thanks to you guys, I've made progress with learning new things.

So far I've only coded in FB... but have seen many demo's on here in PB (remakes and such). Those demo's that I have checked out... seemed rather good, rather smooth, great alpha blending and what not. So I got a little curious to see what PB was all about.

I now have PB 4.60, and have been messing with it only the last 2 days. It is somewhat different to FB, yet somewhat the same.... but seems easier? What I mean by easier is... setting up a screen in PB for windowed/fullscreen (dx9) seems easier (thanks to krazyk for some insight) than doing the same thing in FB (jim's opengl tinyptc equivalent), loading in bmp in 24bit is a hell of a lot easier, wow... that's easy, and having the whole screen alpha blended without losing any FPS = awesome... I've tried some alpha blending in FB (with thanks to shockwave), but it slows the screen a lot if I blend too much, which isn't what I want at all. I also put 18 scrollers on screen at once (800x600) and it still kept it nice and smooth motion at 60fps. I tried this in FB and.... it didn't like it at all.

So far PB seems much easier to work with, code with, include binaries with... I know I want to continue with FB, but it looks like I will also learn PB at the same time.

A big thing for me is the ease of use. The whole alpha blending and how easy it is, is definitely a plus also, and I'm sure there will be more 'awesome' moments as I learn PB too.

What are your thoughts on FB vs PB? regardless of the free vs paid situation. The good? The bad?

My subroutines I want to accomplish in FB are easier to code in PB? (variable width scroller, 24bit logo/background/scroller, sinewaves, star fields, 2d/3d rotations, zoom in/out effect etc)

Thanks in advance.

2
Hey guys... So I was hunting down code and fonts and such for use in my demos/intros and came across Flickr that had a whole heap I found (uploaded by roy/SAC).

The dilemma... you can't mass/batch download files. In having a brief look at his album sets.... I wanted all the bitmap fonts downloaded locally. What I didn't want to do was have to click every damn file 4 times to get it.... so I wrote myself a batch download script in bash/linux.

This is basically how it runs...

Code: [Select]
./flickr.sh 72157611369289453
created directory ./72157611369289453
downloading new source links, please wait...
72157611369289453 flickr source saved
finding number of pages...
grabbing image links on page http://www.flickr.com/photos/cumbrowski/sets/72157611369289453/?page=1
grabbing image links on page http://www.flickr.com/photos/cumbrowski/sets/72157611369289453/?page=2
grabbing image links on page http://www.flickr.com/photos/cumbrowski/sets/72157611369289453/?page=3
grabbing image links on page http://www.flickr.com/photos/cumbrowski/sets/72157611369289453/?page=4
grabbing image links on page http://www.flickr.com/photos/cumbrowski/sets/72157611369289453/?page=5
grabbing image links on page http://www.flickr.com/photos/cumbrowski/sets/72157611369289453/?page=6
1 - downloaded file ./72157611369289453/3122436912_ed8a7d2e17_o_d.png
2 - downloaded file ./72157611369289453/3122436744_1a7142ef7d_o_d.png
3 - downloaded file ./72157611369289453/3122436756_d4c855c722_o_d.png
4 - downloaded file ./72157611369289453/3122436780_c5bbf6bf4a_o_d.png
5 - downloaded file ./72157611369289453/3122436836_dee089a3a2_o_d.png

My script has page checking, error checking etc, and if the file exists... it skips it.

It's hard linked to download only the sets that I want at the moment, but could be adapted for any 'flickr' set/url.

So what did all that mean? It meant that by scripting it, it saved me hours upon hours upon days of manually clicking each link. Now I just run the command for each 'set' of photos I want to grab, and it does the whole lot for me, saves directly to shell/hdd.

Not sure if anyone here is interested in the script for their own use, but if so, hit me up in private message and I'll be happy to share.

As for the ~1200 bitmap fonts that I have now acquired... again if anyone wants them, hit me up in private message, as it's too big to post here.

3
Freebasic / TinyPTC and FPS
« on: February 08, 2012 »
So I've been messing with some more code using TinyPTC++, and with much thanks to Raizor, the variable width scroller is now working as intended.

When blitting my scroller to screen and vsync on, its a constant 60fps. But since I've added in a 800x600 res background graphic that blits to screen in replacement of 'ERASE BUFFER', the fps slows to ~50fps.

My question is...

Is there a way to blit a full screen image using a faster technique in order to keep the screen synced to the refresh rate of the monitor?

Fullscreen mode is 800x600, my background image is also this size. Scroller only at 60fps, nice and smooth, add in the background image and its 50fps and not smooth. :/

Attached is a couple of screen shots 'so far'

*note.. 100% of the graphics I drew from scratch.

4
Freebasic / Variable Width Bitmap Font Help
« on: February 02, 2012 »
In my learning about bitmap fonts and how to lay them out in ascii order as well as a grid pattern with all the same size character width and height, I wanted to see if I could do a variable width bitmap font.

As you can see by the code and the binary, I got it working as I wanted. I know this isn't the best way in doing it, but for an initial test, I got it to work proper.

The main character grids are 64x64px, but like the letter ! and I etc, I only have them at width 19px (background colour is not drawn), starting at the utmost left/top border of the characters 64x64px grid. I then feed this 19px into the scroller routine to only jump the 19px instead of the full 64px, then also run the same loop (for some reason the XJ variable wouldn't parse into the draw routine) for the draw routine.

As I said, this works great. Seeing my screen is 640px wide. so 640/64 = 10 characters on screen at any one time... but now seeing I have the width varied, I need to use the lowest width available which is 19px. so 640/19 = 34 (rounded) chars on screen at any one time + 1 for rendering off screen, so I set this to 35 chars.

I did this in case I end up doing a text of 'oh yeh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" for eg. hehe, so it wouldn't pre blit/render directly on screen which looked ugly. So in the attempt to do it, if most of my chars are 64px wide, then i'ts pre rendering 25 chars off screen, not 1.

Question..

Is there a way to calc whats already on screen pixel wise on the X res, as the chars are variable width, so I only pre render 1 char off screen on the right instead of 25?

Is there a better way/loop/whatever that I can do this character checking based on render-able pixel width in the bitmap than what I have done in code already?

I'm sure this has been done 10001 times before, but being a newbie, this is... well, all new to me ;P

Thanks in advance.

Bin + Source attached.

5
Hey guys.

I wasn't too sure about posting this...

1, due to the fact that this wasn't intended as a 'public release', as it's a small private demo I made for family to 'congratulate them'.
2, it may seem a 'lame' demo to you guys, since I'm a newbie (only been coding for just on 2 months) and your skill sets greatly outweigh mine.

Anyways... I decided to put in some generic text and rar it up for DBF.

A little bit about the demo...

Coded with FreeBasic, the base uses tinyptc_ext++.bi, with graphic/audio conversions done by bin2bas, thanks RBZ.

The graphics were drawn by myself, apart from the initial background image I used (its in the rar also... Bitmap font, Background modification, Congratulations logo were 100% by myself, all done via PhotoShop)

The code.... well as you know, I'm a newbie coder (~2 months) so without your help (yeh, you guys from DBF), It probably would have taken me a lot longer to put together. Code snippets and help were from Shockwave, Raizor, Jim, Stonemonkey etc which is much appreciated.

Music included I found on various sites, so no idea who actually made them.

Screen setup is made to look like layers to give the desired effect, all using screen coordinate masks.

I know it's not the 'next best thing since sliced bread', and it's a production that wasn't intended for public eyes, but it's a production none the less.

I have included the binary as well as the project files, bmp's etc, so you can see how I put it together (sloppy code, but tidied up a lil).

Not sure what you all will think about it... but be nice. *hides*

-ttemper

6
Freebasic / uFmod, plays xm, but not mod?
« on: January 26, 2012 »
Trying to put some music into a demo using uFmod, it works for xm files (bin2bas), but soon as I change it to a mod file (bin2bas), no sound.

Compiling with.... fbc -lang deprecated -s gui

Is there something I'm missing?

Code: [Select]
#INCLUDE ONCE "tinyptc_ext++.bi"
#INCLUDE "sfx\happyanswer.mod.bas"

    Dim hWave As HWAVEOUT
    hWave = uFMOD_PlaySong(@happyanswer.mod(0), 88961, XM_MEMORY)

do

<loop here>

end

uFMOD_StopSong()
EXITPROCESS(0)


7
General coding questions / Full Screen Resolution
« on: January 25, 2012 »
Hi,

So I'm currently messing around with a 800px by 600px res screen, and I have created a background graphic at 800px by 600px, so it should fit 1:1 inside my screen.

My question is this... when I load in the background image and blit it to screen at the 800x600 res, the left border is ok, but the top, right and bottom 1px are missing... all it has is a black line. I only noticed this as i have a 1px border all the way around my graphic. What am I missing?

I'm currently using FreeBasic and Tinyptc_EXT for the screen setup.

The routines I currently am using are....

Code: [Select]
BGIMGX=800
BGIMGY=600

SUB BGLOADIMAGEDATA()
    DIM I as integer
    'Loads Color palette
    FOR I = 0 to 255
         BGIMG_R( i ) = cgbg.pal (i*3)'Red color
         BGIMG_G( i ) = cgbg.pal (i*3+1)'Green color
         BGIMG_B( i ) = cgbg.pal (i*3+2)'Blue color
    NEXT
    FOR I = 0 to (BGIMGX*BGIMGY) - 1
         BGIMG_BUFFER(i) = cgbg.raw (i)
    NEXT
END SUB

SUB BGDRAWIMAGEDATA(BYVAL xpos AS INTEGER,BYVAL ypos AS INTEGER)
    DIM X,Y,PIXEL as INTEGER
    FOR Y = 0 to BGIMGY-1
        FOR X = 0 to BGIMGX-1
            PIXEL = BGIMG_BUFFER(x+(y*BGIMGX))
            BGWRITEIMAGEDATA( x+xpos,y+ypos, (BGIMG_R(pixel) Shl 16) Or (BGIMG_G(pixel) Shl 8 )  Or BGIMG_B(pixel))
        NEXT
    NEXT
END SUB

SUB BGWRITEIMAGEDATA( byval intX As Integer, byval intY As Integer, byval intC As Integer )
    IF ( intX>0 And intX<XRES-1 ) And ( intY>0 And intY<YRES-1 ) Then
BUFFER( (INTX) + (INTY * XRES) ) = INTC
    END IF   
End SUB

I'm not quite sure why the full 800x600 isn't being blitted.

Thanks in advance.

8
hi, i am attempting to do a 'credits' scroller type screen, which i have managed to do (very unoptimized), but at the moment i have the whole text squashed into the loop (as you can see from the code).

at the moment i have the text at 30 lines of 22 chars, so 660 characters total of text. when i keep adding on text, the demo/scroller lags down a heap which i dont want.

what im trying to achieve is similar to a horizontal scroller... for example...

xres = 800
yres = 600
fontcharw = 32
fontchary = 32

position 600+32 (which is 32px offscreen) is where it pre-renders my 22 char wide line then scrolls up onto screen... as soon as that reaches -31, then pre-render the next 22 chars at position 600+32 again, scroll up still and so on.

what my code does at the moment is pre-render offscreen the full 660 characters below 600+32 and then scroll up, soon as my counter reaches the end of text + 600px yres it then loops which is fine and all, but if i can adapt this to save memory and cpu by only pre-rending 1 line at a time then scrolling, then removing 1 line at a time at the top of screen - 32px.

not sure if im explaining myself properly :/

the base code is from one of shockwaves sources that i have changed/adapted to suit my needs, if you can help me out in what i need to do to stop the full 660 chars being processed at once and only 1 line of 22chars each ~31px, thatd be great.

again... much thanks in advance.

Code: [Select]
SUB TEXT1(BYVAL SSPD AS DOUBLE)
'this sub will vertically scroll the text from offscreen bottom to offscreen top, then loop
    DIM AS INTEGER TTX,TTY,XPO,YPO,YR,COUNT

YPO=YRES+64
YR=1
XPO=48

WHILE YR<(LEN(TEXT)/22)
VTEXT1( XPO , YPO+TXPS , MID(TEXT,COUNT,1))
XPO=XPO+32 ' x character spacing
IF XPO>720 THEN
XPO=48 ' 22 chars per line at 32px each = 704. XRES-704 = 96 /2 = 48 (48PX EACH LEFT AND RIGHT BORDER)
YPO=YPO+32' y character spacing
YR=YR+1 ' line counter
END IF
COUNT=COUNT+1
WEND
TXPS=TXPS-(DV*.125)
IF TXPS <= -(LEN(TEXT)/22)*32-(YRES) THEN ' 22 CHARS PER LINE AT 32PX HEIGHT
TXPS=0
ENDIF

VTEXT1 ( 50,0,  "LINES RENDERED YR  :"+STR(YR))
VTEXT1 ( 50,30, "TXPS  :"+STR(TXPS))

END SUB

9
another newbie question...

so i have been messing with graphics in freebasic (tinyptc_ext) and at the moment i have the graphic centered on screen and 200px down from X on a 800x600res screen eg..
|---------------|
|---graphic---|
|---------------|

what im attempting to do is have the graphic move from off screen (top center) and move it down smoothly until it reaches position 200px on xres.

i (sort of) understand the concept, and have tried this with...

Code: [Select]
SUB MOVEINLOGO ()
DIM AS UINTEGER LMOVE
LMOVE = 0
FOR LMOVE=0 TO 200
DRAWIMAGE(78.5,LMOVE)
LMOVE+=1
NEXT
END SUB

but being an utter code newbie, i found out this renders the graphic on screen 255 times moving it down 1px on xres each loop. i did try a different way, but it went from 0 to 255 in a heartbeat, and blitted it on screen straight away at 200px, so that kinda defeated the purpose of what im trying to achieve.

ive tried searching on freebasic forums for help, but no luck. so again, im writing here. i'm sure its easy to do, but extremely difficult for me at the moment.

so basically i want to move the graphic from offscreen (a) to onscreen at xres 200px (b) in a nice smooth (timed) motion, and once it reaches position b, stop and just blit the graphic there (static) for the rest of the duration.

thanks in advance!







10
Ok, so I've spent much time trying to work out how the hell to work this out... and I can't do it.

I thought id change my 2048x32 image back into a 256x256 (8x8 char map @ 32px by 32px char) and try to work out how to calculate when to add 32px onto Y to drop down a line.... but keep the proper offset for X... I'm completely and utterly lost.

Maths isnt my strong point and I'm extremely frustrated, I've tried searching and searching to try and find an example to run off, but for the frustration of me, I still cant work it out. Please help!

The current code is something I pulled from Shockwave's post somewhere on here, which I understand, np... the whole ascii order -32 so it starts at [space], then ! etc.... and then multiply the char by 32 will get the proper 32x32 char... but if it goes >256, thats when I get lost, as I dont know how to drop down by ??px on Y, and keep the correct coordinates on XX.

Like I said, I tried but failed. Im completely stuck being a newbie coder n all, and its just frustrating the hell out of me, especially when i cant find any help text/code anywhere to find out how to do what i want.

Any help is much appreciated to push me in the right direction.

11
General chat / photoshop mess around
« on: January 01, 2012 »
So, as the title says, just a mess around text logo.. testing out different things, techniques, etc and come up with that.

Refined it a lil to this 'result' about 30mins work I guess.

I'm trying to brain storm some graphical ideas to put into a demo (which I'm still learning to code slowly, so it may be sometime still). None the less, thought I'd share. :)


12
Projects / 64x64 bitmap font
« on: December 13, 2011 »
hey all, I wasn't sure where to post this... but here it is (one of), a 64x64px per char font for use in whatever you please.

its a 512x512 bitmap in 256 colours with &HFF00FF background colour for easy masking. Its 64x64, but you can resize easily to 32x32 or 16x16 if you need.

Attached is the 256colour bitmap as well as a 24bit png (just in case you prefer png).

I'll be sure to make some more, until then... enjoy, use as you please.

13
ok, so i have been messing around with tinyptc_ext, and converted my bmp to raw then bas for loading... and used the base code (with some mods) to get my logo up n displayed on screen (what a learning curve... persistence paid off).

ok, so heres the thing... i setup my screen for 800x600 to prompt for fullscreen/windowed, yet the option screen does not appear, it just goes directly into FS. what did i do wrong? nevermind... just changed the 0 to a 1 and it prompted me.

also, the logo i did put into a SIN wave on the X axis which is what i wanted to do, it works fine now (after i added in erase buffer), but 2 things....

1. how do i get the background from black to translucent? aka make it not show up so things under it are not hidden by the black rectangle.

2. how do i get the sinewave that ive put in place to not go so damn fast, it moves across screen back and forth too quick, i want to slow the timing down so its at a nice rhythm.

attached is the source and exe (so far), any thoughts, help, suggestions would be great. thx again.

14
General chat / which language to start with?
« on: December 09, 2011 »
hey guys, so over the last week or so i've been dabbling in coding.

a friend of a friend told me about darkbasic pro "free", so i downloaded it, installed and had a play with it.

i did manage to get a nice sinewave scroller happening with custom bitmap font(s) that i drew in photoshop (yeh i also do graphics), a few 'box' rasterbars that were static and had a sine wave to them also, a couple of moving figure 8 logos (sprites) on screen which did look kinda nice.

the one thing i didnt really like is that the compiles are HUGE... ~4mb for a simple dual scroller, couple of bitmap fonts and logos... ouch.... so the more i researched, the more i saw that darkbasic is frowned upon (i can sorta see why) in the demoscene.

ive read some C++ tutorials on the basic stuff, and its a lil' tricky for me as i dont know c++ at all. zip, nadda, nothing. from noseing around the place, i stumbled here, so i was sure to sign up to get some help/push in the right direction.

by the looks of things c++ and freebasic are the main 2 choices here, freebasic with tinyptr addon etc seems all good n such to me, but the more i googled around the more i found that purebasic was popping up around the place more and more. ive checked some of the syntax/code of the sources that were available... and since i code tcl and bash scripts (dabbled in perl and c) purebasic code seemed more inline and understandable to me than the others for the moment.

so upon comparison of freebasic, c++ and purebasic, it seems purebasic is the better choice for me. what im wanting to know is.... is this a good starting language to learn with? to code some nice scrollers, sinewave rasters/logos, load up some bitmap fonts to use, 2d starfields, etc etc etc (ive seen many great demos and source code already on here and a few were from purebasic).

thoughts? would like to get some opinions of fellow coders that know whats what.

thanks :)


Pages: [1]