gfxgfxFreeBASIC Games Directory Forumgfxgfx
gfx gfx
gfx
Welcome, Guest. Please login or register. May 19, 2013, 12:36:50 AM

Login with username, password and session length
11.5.2013 - Added a webpage for the latest FBGD competition.

13.3.2013 - Members registrations temporary disabled. For all membership requests, please email me: lachie13@yahoo.com

30.11.2012 - The ninth issue of BASIC Gaming is out! Read it here: http://games.freebasic.net/forum/index.php?topic=560.0

22.11.2012 - Be sure to check our currently running annual FBGD game making competition. This year's theme is SEASONS OF THE YEAR, 300 $ first place prize, and the competition runs till 18th of February. Link: http://games.freebasic.net/forum/index.php?topic=559.0
gfx
gfx
*
gfxgfx
gfxgfx gfxgfx
gfxgfx Home Help Search Login Register   gfxgfx
gfx gfx
gfx
Pages: 1 2 3 [4] 5 6 7
Print
Author Topic: Galactic Empire - 1.05 released!  (Read 18412 times)
Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1195


lachie13
View Profile WWW Email
« Reply #45 on: December 31, 2008, 10:42:25 AM »

How much the object oriented nature of the lib prevents you to code with it in procedural-style?
Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
AlZe
Novice
***
Posts: 67


View Profile
« Reply #46 on: January 01, 2009, 04:14:48 AM »

How much the object oriented nature of the lib prevents you to code with it in procedural-style?

I didn't have to rewrite anything of the code structure in order to use it, works really fine and it's very easy to implement.
Logged
AlZe
Novice
***
Posts: 67


View Profile
« Reply #47 on: January 03, 2009, 04:16:26 PM »

GalEmp will be finished soon, there are only a few things i want to do and then I'll leave it the way it is.
Final version will come with source and though my coding is far from professional it might help and inspire someone else.

So what's coming next... ?



Galactic Empire II Teaser



 Shocked Shocked Shocked

I've been looking at some real OpenGL stuff as you can see, so that's where I'm going to continue from Wink
Have a nice evening all!

« Last Edit: January 03, 2009, 05:24:03 PM by AlZe » Logged
Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1195


lachie13
View Profile WWW Email
« Reply #48 on: January 03, 2009, 05:11:25 PM »

Gah.

I get "The application failed to initialized properly (0x0150002)" message with the trailer.

If you find the problem, please provide the download only with the exe too.
« Last Edit: January 03, 2009, 05:13:50 PM by Lachie Dazdarian » Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
AlZe
Novice
***
Posts: 67


View Profile
« Reply #49 on: January 03, 2009, 05:19:26 PM »

Gah.

I get "The application failed to initialized properly (0x0150002)" message with the trailer.

If you find the problem, please provide the download only with the exe too.

Duh, works perfectly fine for me so I can't tell. I usually don't check if initializations are sucessfull..
I guess it's best to post the code so you can compile it yourself and see what's wrong.

Dim As Integer fullscreen = 0

#Include Once "SFML/Graphics.bi"
#Include Once "SFML/Audio.bi"
#Include Once "GL/gl.bi"
#Include Once "GL/glu.bi"

Dim Shared As sfWindowSettings Settings => (24, 8, 2)
Dim Shared As sfVideoMode Mode => (1024, 768, 32)
Dim Shared As sfRenderWindow Ptr App
Dim Shared As sfSprite Ptr Background, Title, Cursor, History
Dim Shared As sfClock Ptr Clock
Dim Shared As sfEvent Event
Dim Shared As sfString Ptr Text
Dim Shared As sfImage Ptr Image
Dim Shared As sfMusic Ptr Music
Dim Shared As sfShape Ptr shape
Dim Shared As sfInput Ptr inputs
Dim Shared As GLuint surface, cloud, rock
Dim Shared As GLUquadricObj Ptr Sphere
Dim Shared As GLfloat LightAmbient(3) => { 0.0f, 0.0f, 0.0f, 1.0f }
Dim Shared As GLfloat LightDiffuse(3) => { 1.0f, 1.0f, 1.0f, 1.0f }
Dim Shared As GLfloat LightPosition(3) => { 0.0f, 2.0f, -4f, 1.0f }
Dim Shared As Integer mouse_x, mouse_y

If fullscreen Then
App = sfRenderWindow_Create(Mode , @"Galactic Empire II - The Future", sfFullscreen, Settings)
Else
App = sfRenderWindow_Create(Mode , @"Galactic Empire II - The Future", sfClose, Settings)
EndIf
sfRenderWindow_ShowMouseCursor(App, sfFalse)
sfRenderWindow_SetCursorPosition(App, Mode.width/2,mode.height/2)

sfRenderWindow_PreserveOpenGLStates (App, sfTrue)

' Create text
Text = sfString_Create()
sfString_SetText(Text, "by AlZe")
sfString_SetSize(Text, 30)
sfString_SetColor(Text, sfColor_FromRGB(255,255,255))
sfString_SetPosition(Text, mode.width/2-50, mode.height - 50)

' Create background
Background = sfSprite_Create()
sfSprite_SetImage(Background, sfImage_CreateFromFile("background.jpg"))
sfSprite_SetScale(Background, Mode.width/sfSprite_GetWidth(Background),Mode.height/SfSprite_GetHeight(Background))

' Create cursor
Cursor = sfSprite_Create()
sfSprite_SetImage(Cursor, sfImage_CreateFromFile("cursor.png"))

' Create title
Title = sfSprite_Create()
sfSprite_SetImage(Title, sfImage_CreateFromFile("title.png"))
sfSprite_SetPosition(Title, 50, -5)

' Create history
History = sfSprite_Create()
sfSprite_SetImage(History, sfImage_CreateFromFile("history.png"))
sfSprite_SetPosition(History, 25, 175)
sfSprite_SetScale(History, 0.5, 0.5)

' Create textures
Image = sfImage_CreateFromFile("surface.png")
glGenTextures(1, @surface)
glBindTexture(GL_TEXTURE_2D, surface)
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, sfImage_GetWidth(Image), sfImage_GetHeight(Image), GL_RGBA, GL_UNSIGNED_BYTE, sfImage_GetPixelsPtr(Image))
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR)

Image = sfImage_CreateFromFile("clouds.jpg")
glGenTextures(1, @cloud)
glBindTexture(GL_TEXTURE_2D, cloud)
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, sfImage_GetWidth(Image), sfImage_GetHeight(Image), GL_RGBA, GL_UNSIGNED_BYTE, sfImage_GetPixelsPtr(Image))
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR)

Image = sfImage_CreateFromFile("rock.jpg")
glGenTextures(1, @rock)
glBindTexture(GL_TEXTURE_2D, rock)
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, sfImage_GetWidth(Image), sfImage_GetHeight(Image), GL_RGBA, GL_UNSIGNED_BYTE, sfImage_GetPixelsPtr(Image))
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR)

' Enable Z-buffer read and write
glDepthMask(GL_TRUE)
glClearDepth(1.f)

' Setup a perspective projection
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(60.f, 1.33f, 1.f, 500.f)

' Setup light
glLightfv(GL_LIGHT1, GL_AMBIENT,  @LightAmbient(0))
glLightfv(GL_LIGHT1, GL_DIFFUSE,  @LightDiffuse(0))
glLightfv(GL_LIGHT1, GL_POSITION, @LightPosition(0))
glEnable(GL_LIGHTING)
glEnable(GL_LIGHT1)

' Bind our texture
glEnable(GL_TEXTURE_2D)
glShadeModel(GL_SMOOTH)
glBlendFunc(GL_SRC_ALPHA,GL_ONE)
glEnable(GL_DEPTH_TEST)

' Create sphere
Sphere = gluNewQuadric()
gluQuadricNormals(Sphere, GL_SMOOTH)
gluQuadricTexture(Sphere, GL_TRUE)

'glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
'glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)

glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP)
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP)

' Create clock
Clock = sfClock_Create()

' Load and play music
music = sfMusic_CreateFromFile("music.ogg")
sfMusic_Play(music)
sfMusic_SetLoop(music, sfTrue)
sfMusic_SetVolume(music, 100)

' Start game loop
While (sfRenderWindow_IsOpened(App))

' Process events
While sfRenderWindow_GetEvent(App, @Event)

' Close window : exit
If Event.Type_ = sfEvtClosed Then sfRenderWindow_Close(App)

' Escape key : exit
If Event.Type_ = sfEvtKeyPressed And Event.Key.Code = sfKeyEscape Then sfRenderWindow_Close(App)

' Adjust the viewport when the window is resized
'If Event.Type_ = sfEvtResized Then glViewport(0, 0, Event.Size.Width_, Event.Size.Height)
Wend

' Draw background
sfRenderWindow_DrawSprite(App, Background)

' Clear depth buffer
glClear(GL_DEPTH_BUFFER_BIT)
glMatrixMode(GL_MODELVIEW)

' Draw planet surface
glLoadIdentity()
glBindTexture(GL_TEXTURE_2D, surface)
glColor4f(1.f, 1.f, 1.f, 1.f)
glDisable(GL_BLEND)
glTranslatef(2.0f, -1.0f, -3.0f)
glRotatef(-90, 1.f, 0.f, 0.f)
glRotatef(sfClock_GetTime(Clock), 0.f, 0.f, 1.f)
gluSphere(Sphere, 1.975f, 64, 64)

' Draw planet cloud
glLoadIdentity()
glBindTexture(GL_TEXTURE_2D, cloud)
glColor4f(1.f, 1.f, 1.f, 1.f)
glEnable(GL_BLEND)
glTranslatef(2.0f, -1.0f, -3.0f)

glRotatef(-90, 1.f, 0.f, 0.f)
glRotatef(sfClock_GetTime(Clock)*2, 0.f, 0.f, 1.f)
gluSphere(Sphere, 2f, 64, 64)

' Draw rock
glLoadIdentity()
glBindTexture(GL_TEXTURE_2D, rock)
glColor4f(1.f, 1.f, 1.f, 1.0f)
glDisable(GL_BLEND)
glTranslatef(2.0f, -1.0f, -3.0f)
glRotatef(sfClock_GetTime(Clock)* 10, 0.f, 1.f, 0.f)
glTranslatef(0.0f, 0.0f, -4f)
glRotatef(-90, 1.f, 0.f, 0.f)
glRotatef(sfClock_GetTime(Clock)*5, 0.f, 0.f, 1.f)
gluSphere(Sphere, 0.25f, 32, 32)

' Draw border
shape = sfShape_CreateRectangle(0,0,mode.width,mode.height/5,sfColor_FromRGB(0,0,0),1,sfColor_FromRGB(150,150,150)): sfRenderWindow_DrawShape(App, shape): sfShape_Destroy(shape)
shape = sfShape_CreateRectangle(0,mode.height-mode.height/5,mode.width,mode.height,sfColor_FromRGB(0,0,0),1,sfColor_FromRGB(150,150,150)): sfRenderWindow_DrawShape(App, shape): sfShape_Destroy(shape)

' Draw title
sfRenderWindow_DrawSprite(App, Title)

' Draw history
sfRenderWindow_DrawSprite(App, History)

Inputs = sfRenderWindow_GetInput(App)
mouse_x = sfInput_GetMouseX(Inputs)
mouse_y = sfInput_GetMouseY(Inputs)

' Draw text
sfString_SetText(Text, "by AlZe")
sfString_SetSize(Text, 30)
sfString_SetColor(Text, sfColor_FromRGB(255,255,255))
sfString_SetPosition(Text, mode.width/2-50, mode.height - 50)
sfRenderWindow_DrawString(App, Text)

If mouse_x >= sfSprite_GetX(History) And mouse_x <= sfSprite_GetX(History) + sfSprite_GetWidth(History) And _
   mouse_y >= sfSprite_GetY(History) And mouse_y <= sfSprite_GetY(History) + sfSprite_GetHeight(History) Then
sfString_SetSize(Text, 25)
sfString_SetColor(Text, sfColor_FromRGB(0,100,255))
sfString_SetText(Text, "You've just seen the beginning..")
sfString_SetPosition(Text, 50, 400)
sfRenderWindow_DrawString(App, Text)
sfString_SetText(Text, "Prepare for something bigger..")
sfString_SetPosition(Text, 50, 450)
sfRenderWindow_DrawString(App, Text)
EndIf

' Draw cursor
sfSprite_SetPosition(Cursor, mouse_x, mouse_y)
sfRenderWindow_DrawSprite(App, Cursor)

sfRenderWindow_Display(App)
Wend

' Destroy textures
glDeleteTextures(1, @surface)
glDeleteTextures(1, @cloud)
glDeleteTextures(1, @rock)

Logged
Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1195


lachie13
View Profile WWW Email
« Reply #50 on: January 03, 2009, 05:37:48 PM »

I seem to be missing some bi files.

BTW, you sure I got all dll files I need?
Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
AlZe
Novice
***
Posts: 67


View Profile
« Reply #51 on: January 03, 2009, 06:05:15 PM »

Those are all DLLs I use and it works for me.. Huh
Logged
Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1195


lachie13
View Profile WWW Email
« Reply #52 on: January 03, 2009, 06:31:15 PM »

I still need the included bi files.
Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
AlZe
Novice
***
Posts: 67


View Profile
« Reply #53 on: January 03, 2009, 06:42:51 PM »

Ok, hope this helps: http://freefile.kristopherw.us/uploads/alze/sfml.rar
Logged
BadMrBox
Forum Sage
*****
Gender: Male
Posts: 371



View Profile WWW
« Reply #54 on: January 03, 2009, 09:37:13 PM »

Works for me and it looks nice.
Logged

AlZe
Novice
***
Posts: 67


View Profile
« Reply #55 on: January 04, 2009, 09:07:47 AM »

Beta is here, and thus no more additional game features and changes.

I feel it's incomplete in a lot of ways but I finally want to get it finished so I chose the latter.
Looking back how it started I think it's actually a very good game already and there's always room for content/feature patches when necessary Smiley

Changes below:
- added support for multiple starsystems - each with dozens of planets mind you Cool, I've set it to 5 systems in the beta, willl be free to choose in the final
- lots of polishing, bugfixing and code cleanups
- some new graphics
- took the game music from my older game (Moon Project)
- music tracks switch during the game
- you can zoom out further
- planets are not rendered when zoomed out - instead they are replaced by simple circles
- additional planet info
- added more planet names (still a lot more necessary)

Known Issues:
- AI doesn't build turrets (not yet implemented)
- screen stays black after changing resolution - possibly SMFL bug
- game runs a lot slower now, probably because I quintupled the amount of planets and thus the calculating time - will work on a workaround for that Wink
- ending stats not yet re-implemented Roll Eyes
- lots of bugs i've probably missed
- balancing may be off a bit too - fleet speeds, satellite, turret costs etc.

For Download see first post!
« Last Edit: January 04, 2009, 09:09:03 AM by AlZe » Logged
Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1195


lachie13
View Profile WWW Email
« Reply #56 on: January 04, 2009, 01:36:49 PM »

I was able to compile, but playing with starting resolution, full or not full screen start didn't help.

Anyway, downloaded the Galactice Empire BETA today and same error. I think my PC has a problem with SMFL. Ack! Will report this in the main forum.
Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
AlZe
Novice
***
Posts: 67


View Profile
« Reply #57 on: January 04, 2009, 01:57:10 PM »

Hey Lachie,

look at this: http://www.daniweb.com/forums/thread114762.html
Maybe that's the problem..

I just checked and I have Microsoft Visual C++ Redistributable installed, though I don't know why Roll Eyes

Of course I would prefer if people won't have to install it but give it a try, maybe it works.
Unfortunately I don't have a clue how this DLL and lib linking etc. works at all so I don't know how to do it differently.
Logged
nkk_kan
Forum Howler
****
Gender: Male
Posts: 180

Let's rocK~!

nkk_kan
View Profile WWW Email
« Reply #58 on: January 04, 2009, 02:04:48 PM »

Doesn't run on mine.. Sad

here's what i get

Quote
GalEmp II.exe has encountered a problem and needs to close.  We are sorry for the inconvenience.

Error signature
AppName: galemp ii.exe    AppVer: 0.0.0.0    ModName: csfml-graphics.dll
ModVer: 0.0.0.0    Offset: 000818fa


any idea?  Huh

Logged

AlZe
Novice
***
Posts: 67


View Profile
« Reply #59 on: January 05, 2009, 01:56:57 AM »

Have you guys been able to run it with the Redistributable?
Logged
Pages: 1 2 3 [4] 5 6 7
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Cerberus design by Bloc
Valid XHTML 1.0! Valid CSS!
gfx
gfxgfx gfxgfx