Author Topic: First attemp at OpenGl with c# and Tao  (Read 13175 times)

0 Members and 1 Guest are viewing this topic.

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
First attemp at OpenGl with c# and Tao
« on: December 01, 2009 »
I  reacently finished my first Game using c# and Tao framework OpenGL and  I have uploaded it because this is my first attempt (as you can tell by the basic look of the program) and I wondered what people thought of it and if I was heading in the right direction.

In the game press space to fire only one bullet on screen at a time and user the left and right keys to move your ship.

Any and all constructive criticism is welcome You will need the Tao framework to run the game.

(I think i've got it to run without Tao now it seems to work on my freinds systems)

edit (I've removed the other uploads and I've put up the newest version on this post (i think i've fixed the timing issue as well))

edit(just got my coursework on this back and got 100%(thats on the game as it was hen i first posted it) but thanks for the help off everyone in improving it since i handed it in this program has turned into quite a learning experience cheers)
« Last Edit: December 27, 2009 by James_wright_1990 »
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #1 on: December 02, 2009 »
I would have loved to test this, but to be honest I don't wanna download a 33.6MB framework to  be able to run it. Do you always need the whole framework to run such programs or is there a runtime library I just didn't see?

Challenge Trophies Won:

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #2 on: December 02, 2009 »
Hi there,

I had a quick play of the game and it works well :)

Definetly heading in the right direction from the short play I had.

I haven't had a chance to have a look at the code but I did get it to build.

I hadn't heared of the Tao library before, it looks great!

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #3 on: December 02, 2009 »
It good attempt for first time and it would be nice to pressing spacebar often for more bullets La La La Rambo! LOL  ;)  :)

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #4 on: December 02, 2009 »
Thanks for the comments I know there are a few tings in the code that need sorting out and I'm currently doing a minor rejig of it to sort them out. Also if anyone knows of any good tutorials for doing textures could they please let me know because I would realy like to add a background and put some textures on the enemies to make it look better.

Anywho cheers for the comments.

(the reason that only one bullet is allowed is that this was a piece of coursework I just handed in a few days ago and one of the spec requirments was only one bullet per ship on the screen at a time I will be adding the ability to have more bullets now I have handed it in).
« Last Edit: December 02, 2009 by James_wright_1990 »
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: First attemp at OpenGl with c# and Tao
« Reply #5 on: December 02, 2009 »
If anyone wants to run this, go into the opengl_betterdeaths folder then opengl_withstates then opengl_withstates then bin then debug and run the opengl_withstates.exe file. All the dlls needed seem to be in that folder.

It's a good first game James,I like the idea of space invaders with bosses :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #6 on: December 02, 2009 »
Sorry i forgot to say where the .exe was. I've done a minor rework of the code and added the facilty for multiple player bullets (currently capped at two but easy to change) anywho it all looks the same as im still having some trouble with textures but I'm hoping to get it sorted soon. anywho here's the (slightly) newer version.
« Last Edit: December 04, 2009 by James_wright_1990 »
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #7 on: December 02, 2009 »
Unlimted Bullets pls  :kewl:

I have noitce when I face the boss and i shoot him then his Boss Health numbers went minus very quickly and secondly...I couldnt kill him as I hit him about 5 or 7 times....it is bugs?  :P

It would be cool to see Angry Square animations when they been hit and when they shoot at me...they laugh  ;)

keep going  :)

Offline staticgerbil

  • Atari ST
  • ***
  • Posts: 113
  • Karma: 8
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #8 on: December 03, 2009 »
I"m not sure if you're still after some GL tutorials but I've always found the best GL stuff to be on Nehe

http://nehe.gamedev.net/

[Edit:] Texture tutorials starting from this page http://nehe.gamedev.net/lesson.asp?index=02

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #9 on: December 03, 2009 »
Could you have implemented a multi-fire power up for extra credit? :)

Jim
Challenge Trophies Won:

Offline mziskandar

  • C= 64
  • **
  • Posts: 46
  • Karma: 1
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #10 on: December 03, 2009 »
Unlimted Bullets pls  :kewl:

I have noitce when I face the boss and i shoot him then his Boss Health numbers went minus very quickly and secondly...I couldnt kill him as I hit him about 5 or 7 times....it is bugs?  :P

It would be cool to see Angry Square animations when they been hit and when they shoot at me...they laugh  ;)

keep going  :)

I tried to kill the boss.. getting the minus stuff too..

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #11 on: December 03, 2009 »
Sorry about the boss bug im on it its something to do with the multiple bullets im not sure what exactly. The reason I caped number of bulltes at two is im looking at adding the ability to use your points as money and buy upgrades for the ship and more bullets will be one of the upgrades (I'll get the boss bug fixed first). 
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #12 on: December 03, 2009 »
Fixed the bufg it was my fault I had changed the collisional code for the boss and forgot to change the bool I'm using to say that he had beed shot by a bullet back to false after I took a life off sorry about that anyway heres the fixed version and whould have the upgrades working soon.

James
« Last Edit: December 04, 2009 by James_wright_1990 »
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #13 on: December 03, 2009 »
very good.  I have notice, there is slowdown that need to be fixed :)


Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #14 on: December 03, 2009 »
Hi can you tell me if the game is just generaly running slow or if there is a slowdown under certain circumstances because it seems to work fine on my computer and I havn't changed any of the other code but it might just be luck that it runs fine on mine I realy dont know.

Anywho Thanks for telling me I'm looking in to it.

James.
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #15 on: December 03, 2009 »
I think it is slowdown due to having quite lots of bullets on the screen I think.
Have you put timer in just make sure it run the same for every computer...for example....if is run on your computer like 60FPS( Frames per seconds) then it should run the same for any pc computer :)

I am sure shockwave know about OPENGL on running the same FPS on every computer I think.

My PC Spec are

2GHZ
3GB
GEFORCE 9600M GT
WINDOW 7 Ultimate  :kewl:

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #16 on: December 03, 2009 »
I use Glut.glutTimerFunc to call update ruffly 100 times a secondIi think the problem is that its not precisly 100 times a second because the timer gets reset at the end of update and update takes slightly longer the more bullets it has to update im workig on a way to adjust for this discrepancy when reseting the timer but I'm not sure where to start. I'm also trying to change it to make my collidional code work faster so that more bulets has less of an impact on performance. Hopefully I will have it fixed soon.

James

edit(The idea of adjusting the timer doesnt work  i gues i've missunderstood how glut works)
« Last Edit: December 03, 2009 by James_wright_1990 »
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #17 on: December 03, 2009 »
I've changed the code for the bullets so it runs faster (they're circles so priviousely i did the maths to make the circle every time a bullet is created now i do the maths once when the program is turned on and use those coordinates for all of the bullets) it seems to have made it run a little faster I've tested it on my freinds laptop that is lower spec than mine and it appears to be working there is still a slight chug in the frame rate if there is alot of enemies and bullets on the screen Im working on a solution for that but you should have to get fairly far before you notice.

edit(sorry about that being in two separate posts I forgot I could modify the earlier posts. Also cheers for the support this has really helped me find problems in the way I code)

James
« Last Edit: December 04, 2009 by James_wright_1990 »
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #18 on: December 03, 2009 »
The only hires timer in .Net is the StopWatch class, maybe you should try using that.  All the others suffer from low resolution (1/18th second) and/or high latency (lumpy delivery of events).

Jim
Challenge Trophies Won:

Offline James_wright_1990

  • C= 64
  • **
  • Posts: 48
  • Karma: 4
    • View Profile
Re: First attemp at OpenGl with c# and Tao
« Reply #19 on: December 03, 2009 »
Cheers for the help Jim I've just changed it to work using StopWatch as a timer and it seams to be working perfectly I'm just testing it to check its all running fine but at the moment it's all looking good at the moment.

James.
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.