Qbasicnews.com
July 05, 2020, 02:57:22 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Antiquity  (Read 5657 times)
undertow
New Member

Posts: 9


« on: January 10, 2005, 11:58:41 AM »

After breaking the QBasic compiler by having too much code and not being able to put it into libraries, I decided to do this project in Freebasic instead. Now there are no tricky Future library XMS work arounds thanks to *almost* unlimited memory.

Six days and 80kb of 90% new code later, rewriting the memory, graphics and core components I have my first release of this Civilization style game.

This game was originally created by Kristoffer and Sune Olsen. It and its pascal source code were released as freeware and I've used the original graphics file (so dont blame me if you cant work out the graphics) and rule set.

The game itself was never finished, reaching alpha status with no AI. As yet I am still quite some time from getting to that stage, and then hopefully past it, adding some form of AI.

I need to rewrite the graphics, at the moment its doing (equivalently) over 256,000 PSET's a frame. Hence even on a fast computer you may only see a few frames per second and a delay in the input to result.

The game can be downloaded here at http://ucc.gu.uwa.edu.au/~undertow/pub.zip and I strongly urge you to read the README.TXT (not comprehensive but perhaps enough to get the feel of the game) because the game is similar but rather different. Don't get too attached to the game because you cant save/load yet.
Important: This game uses SDL, so make sure you have the DLL file.
Logged
Z!re
*/-\*
*****
Posts: 4599


« Reply #1 on: January 10, 2005, 03:20:06 PM »

[half pseudo code thingy]

Surface = SDL_CreateRGBSurface
PSET images to surface

Do
SDL_BlitSurface 'image to screen
Loop

[/half pseudo code thingy]
Logged
v3cz0r
I hold this place together
*****
Posts: 924



WWW
« Reply #2 on: January 10, 2005, 11:46:28 PM »

Really cool, ran at ~50 fps here, even doing all with PSET, ow ;)

You ported it from pascal or had a pre-working QB version? I guess the code is quite complex..
Logged

undertow
New Member

Posts: 9


« Reply #3 on: January 11, 2005, 04:05:24 AM »

Quote from: "Z!re"
[half pseudo code thingy]

Surface = SDL_CreateRGBSurface
PSET images to surface

Do
SDL_BlitSurface 'image to screen
Loop

[/half pseudo code thingy]


It actually seems to go a couple of FPS slower although the advantage in this method is that it no longer needs to lock and unlock the surface.
I've now made it so that it only updates when it needs to instead of just drawing frame after frame.
Logged
undertow
New Member

Posts: 9


« Reply #4 on: January 11, 2005, 04:14:05 AM »

Quote from: "v3cz0r"
Really cool, ran at ~50 fps here, even doing all with PSET, ow Wink

You ported it from pascal or had a pre-working QB version? I guess the code is quite complex..


I'm up to 108 subs and functions and still counting! I've separated it into 9 files with one well organised header file so it helps me find where they all are. As I'm sure you can imagine debugging is a nightmare.

I ported it from pascal to QB but the code had to be modified as it used OOP. The FB port is much different to the QB version because I no longer need the Future library routines to get around memory problems etc. Its actually starting to look very C ish.
Logged
Anonymous
Guest
« Reply #5 on: February 08, 2005, 11:51:11 AM »

I've finished as much as I'm willing/able to do at the moment. Its 95% playable, but no AI. I've also released the source code. If anyone is willing to help complete it, then by all means go for it. I've also made an incomplete web site with some basic documentation to it.

The code is messy but i have tried to make it as readable/logical as possible. Apart from this I hope someone likes the concept behind the game (remembering I didn't do the graphics).

The documentary/source/game is available at :
http://undertow.ucc.asn.au or
http://www.ucc.gu.uwa.edu.au/~undertow/

Thanks v3cz0r, nothing seemed to go wrong compiler side for over 200kb of code, anothing FreeBasic success story.
Logged
Z!re
*/-\*
*****
Posts: 4599


« Reply #6 on: February 08, 2005, 12:10:39 PM »

Make sure you make the surfaces HWSURFACE, and fullscreen video.

Windowed mode you never know what you get, as windows still controlls it.
And SDL will emulate the color depth and hw acceleration (there is no hw accel)

So, 32bit on a 16bit desktop will be way slower than 32bit in fullscreen. Or 16bit on a 32bit desktop.


Also, some gfx cards support HW blitting, which speeds blitting up a lot.
Logged
VonGodric
Ancient Guru
****
Posts: 674



WWW
« Reply #7 on: February 08, 2005, 12:11:13 PM »

looks cool, runs smoothly here, keep up good work!
Logged

url]http://fbide.sourceforge.net/[/url]
undertow
New Member

Posts: 9


« Reply #8 on: February 08, 2005, 12:21:02 PM »

Quote from: "Z!re"
Make sure you make the surfaces HWSURFACE, and fullscreen video.

Windowed mode you never know what you get, as windows still controlls it.
And SDL will emulate the color depth and hw acceleration (there is no hw accel)

So, 32bit on a 16bit desktop will be way slower than 32bit in fullscreen. Or 16bit on a 32bit desktop.


Also, some gfx cards support HW blitting, which speeds blitting up a lot.


I couldn't get the mouse to show in fullscreen mode using SDL_ShowCursor, so I settled for windowed. Perhaps that isn't the correct command to use.
Logged
Z!re
*/-\*
*****
Posts: 4599


« Reply #9 on: February 08, 2005, 12:30:24 PM »

Nothing wrong with windowed, and nothing wrong with plotting individual pixels either.

Code:
result = SDL_ShowCursor ( 0 )

0 = Hide
1 = Show

You can ignore result:
Code:
SDL_ShowCursor ( 1 )

Mouse cursor is visible by default in SDL.

To get the mouse position and which button is being pressed:
Code:
Dim XMouse as integer
Dim YMouse as integer

MouseBTN = SDL_GetMouseState(@XMouse, @YMouse)

Would retreive mous x and y position, and which buttons are being pressed.

Note though, that:
Left mousebutton = 1 (bit 1)
Center mousebutton = 2 (bit 2)
Right mousebutton = 4 (bit 3)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!