Clan x86

Technical (Development, Security, etc.) => General Programming => New Project Announcements => Topic started by: Warrior on June 16, 2006, 01:01:34 pm

Title: RTS Type Game
Post by: Warrior on June 16, 2006, 01:01:34 pm
I've started work on a simple Real Time Strategy (Think SC, WC, etc..) game.
I'm looking for help though since any game project is doomed withought a team.
I'm still debating:
Map format
UDP, TCP, or both
Opensource-ness (If so licensing)
Cross platform (Linux with OpenGL and a cross platform Audio Library)

What I currently use is:
3D Engine: Ogre3D (ogre3d.org)
GUI System: (In Game GUI) CEGUI (Crazy Eddies GUI) which is a scriptable GUI system
Resource Archive Format: Probably Zip unless I can find something better, I'm not too worried with people modifying the game

It will be both multiplayer and single player.

I'd be willing to put up a Forum/Wiki/SVN Repos so we can work easier.
My development platform is Windows XP SP2 with VS 2005 Express (C++) non managed.

My current progress:
Got Ogre initiated and I'm starting to seperate things into classes. I'm going to document more in proposals of what I think can be done.

If anyone is interested just reply. Really there are no requirements, just the will to contribute in some way.

It's meant to be a learning experience with something a little more realistic than an MMO.
Title: Re: RTS Type Game
Post by: rabbit on June 16, 2006, 01:28:56 pm
yes but i neeed vs2005\
Title: Re: RTS Type Game
Post by: MyndFyre on June 16, 2006, 02:00:22 pm
yes but i neeed vs2005\
Noob plz.
http://msdn.microsoft.com/vstudio/express/visualc/download/default.aspx
Title: Re: RTS Type Game
Post by: Chavo on June 16, 2006, 02:02:10 pm
Wish I had the time, but...I don't.
Title: Re: RTS Type Game
Post by: Warrior on June 16, 2006, 02:09:27 pm
It's Warrior..all programmers must assemble themselves out of fear. No is not an option.
Bring tea and cookies for my press conference with Chuck Norris, I'm going to turn him down. Yes I'm that damn badass.
Title: Re: RTS Type Game
Post by: rabbit on June 16, 2006, 03:17:52 pm
yes but i neeed vs2005\
Noob plz.
http://msdn.microsoft.com/vstudio/express/visualc/download/default.aspx

Fine, slut.

@Warnugget: I'll download later and install etc and tell you.
Title: Re: RTS Type Game
Post by: Warrior on June 18, 2006, 11:41:13 am
(http://www.javaop.com/uploads/guest/RTSUI.PNG)

Added a prelim GUI to the game. Using CEGUI(latest) with a skin which can be changed.
XML for Windoow/Widget layouts for easy development.

Currently, I'm rewriting parts of the base to accomondate new ideas I've had and the networking code (Using RakNet an opensource UDP library) which I've begun to implement.

The game I've decided will be open source, LGPL and cross platform.

Todo:
- Abstract methods of creating simple CEGUI dialogs (Message Boxes, Popups Boxes, maybe floating buttons, etc..)
- Write a CEGUI skin
- Switch modes (Menu, In Game, In Chat, etc..)
- Abstract Multiplayer/Single player eg.

- You move to location xxxx
- That command gets sent to the command processor in game which sends it to RTS Core, RTS Core checks our state (Online/Offline) and forwards it either to the game AI or all of the players.

Things to consider:
-Multiplayer games may contain AI, treat them as players connected? How if we're using a UDP system will we have the concept of AI? Will they be local server clients and UDP connects to them? *Sigh*

Another thing to consider would be game chatting and how far I'd like to take it, multiple chat rooms? One room per server?

Also game lobbys will be like the ones in SC right now? Probably.
Title: Re: RTS Type Game
Post by: MyndFyre on June 18, 2006, 01:00:54 pm
You're making an application.  Why LGPL?  GPL, zlib, or BSD are better ways to go.  LGPL was made for libraries.
Title: Re: RTS Type Game
Post by: Warrior on June 18, 2006, 04:17:35 pm
I don't agree with the restrictions with GPL. Basically if you would like to use a portion of the code just acknowledge where it came from and provide the edited source. With GPL if you link it with any other code all that code must be open source as well. That's a restriction I don't like, I'm not very fond of GPL's cancerous attributes.
Title: Re: RTS Type Game
Post by: rabbit on June 18, 2006, 05:09:55 pm
BSD is a good license then.
Title: Re: RTS Type Game
Post by: Warrior on June 18, 2006, 05:30:03 pm
I used LGPL because I didn't feel like looking up GPL compatible licenses, *shrug*
Title: Re: RTS Type Game
Post by: MyndFyre on June 19, 2006, 12:08:48 am
BSD is still the appropriate license.

Incidentally, why are you using a 3d engine at all?  Then you have to find modelers and still overcome all of the other art-related hurdles you'd need to defeat in creating an MMO or related-type things.
Title: Re: RTS Type Game
Post by: Warrior on June 19, 2006, 09:30:59 am
BSD is still the appropriate license.

Incidentally, why are you using a 3d engine at all?  Then you have to find modelers and still overcome all of the other art-related hurdles you'd need to defeat in creating an MMO or related-type things.

RTS models are relatively low poly, I can either pay to have them done or model them myself. Texturing is relatively easy and the models are low poly and don't have to be carved in.
Title: Re: RTS Type Game
Post by: Chavo on June 19, 2006, 10:01:51 am
Things to consider:
-Multiplayer games may contain AI, treat them as players connected? How if we're using a UDP system will we have the concept of AI? Will they be local server clients and UDP connects to them?

Building the AI engine seperately to simulate another player is definately the easiest method as far as structuring is concerned (and the most logical IMO).  You wouldn't have to simulate remote connections though.  Personally I would abstract the connection layer so that it could be implemented in multiple ways and added onto later without issues.
Title: Re: RTS Type Game
Post by: Warrior on June 19, 2006, 10:14:53 am
Things to consider:
-Multiplayer games may contain AI, treat them as players connected? How if we're using a UDP system will we have the concept of AI? Will they be local server clients and UDP connects to them?

Building the AI engine seperately to simulate another player is definately the easiest method as far as structuring is concerned (and the most logical IMO).  You wouldn't have to simulate remote connections though.  Personally I would abstract the connection layer so that it could be implemented in multiple ways and added onto later without issues.

Sure but if I'm using UDP where does the CPU come from? It's basically clients only pass information back and forth to every user. The only way I can think of is to maybe have the creator of the game be simulated CPU. He would send his information and that of each CPU. Also we can couple players with a CPU as well to manage, they would send their respective information and then that of the CPU.

I'd have to look into how others have overcome this issue.
Title: Re: RTS Type Game
Post by: Chavo on June 19, 2006, 10:22:00 am
If you are going to have a multiplayer game over the internet, you virtually must have a way of syncing data.  In general (or at least to my knowledge) this is done by making one person the host of the game and having them sound out periodic sync requests and sync data to ensure all players have the same values for their client.  Otherwise things like memory hacks, our cummulative delay could have an impact on the game.

If you implemented this, it would be relatively easy for the host to create the necessary AI player clients on his machine at game startup.  With an abstraction layer, it would still be easy to handle the syncing without any of the clients complaining.
Title: Re: RTS Type Game
Post by: Warrior on June 19, 2006, 10:34:35 am
Okay I'll look into this some more, I'll admit I need to research more in this area on how others have done it.
I also realized to have a decent reliable chat network I'll need to write my own TCP library or add onto RakNet.

Thanks.
Title: Re: RTS Type Game
Post by: MyndFyre on June 19, 2006, 03:51:10 pm
IIRC Starcraft does this by having the host run the computer players.  UDP packets are sent by the computers to the other players just as if the computers were simply other players coming from the same host.
Title: Re: RTS Type Game
Post by: Warrior on June 19, 2006, 04:05:24 pm
That's what I thought, either that or each player had a cpu running.

Heres how I plan it out:

Master server will have a list of registered servers with it, here is how games are created and they are removed from the list once they are started.

Everything else in game will be UDP except for how will I handle stats reporting back to the game? I'm thinking have every specific client send the server it's end game stats via TCP? Or maybe not even log stats at all?

*shrug*
Title: Re: RTS Type Game
Post by: rabbit on June 19, 2006, 09:41:00 pm
*cough*
http://books.slashdot.org/article.pl?sid=06/06/19/1434223&from=rss
Title: Re: RTS Type Game
Post by: Warrior on June 20, 2006, 08:59:23 am
I wouldn't want to (and would feel really bad) about selling a game based off someone elses libraries.
Title: Re: RTS Type Game
Post by: rabbit on June 20, 2006, 09:22:35 am
Not necessarilly selling, but marketing: how to get people to at least download and try it.
Title: Re: RTS Type Game
Post by: Warrior on June 20, 2006, 09:58:31 am
Alright I'll have a look at it later
Title: Re: RTS Type Game
Post by: Joe on June 25, 2006, 12:45:40 am
Downloading VB Express and VC Express. I may join when I learn more VC.
Title: Re: RTS Type Game
Post by: wires on June 25, 2006, 01:22:33 am
Never knew VC was a language.  I can send you VC6 again if you want. XD
Title: Re: RTS Type Game
Post by: MyndFyre on June 25, 2006, 07:02:35 pm
Never knew VC was a language.  I can send you VC6 again if you want. XD
VC2005 pwns VC6.  :P
Title: Re: RTS Type Game
Post by: Warrior on July 27, 2006, 06:46:54 pm
A small update: I really disliked Ogre more and more over time so I decided to write my own Game Engine. This might put the game on halt for a while but it will be more educational in the end. Currently the engine I'm working on is in pure C# using Managed DirectX and the RTS will end up being Managed as well.

All I can say is, damn Managed DirectX is elite.

I'm licensing the engine under the LGPL license and the game will be probably end up being GPL.

I'm still looking for all the help possible on the C# Engine though, I have the design pretty much laid out and I've started implementing it. Stay tuned for primitive screenshots!
Title: Re: RTS Type Game
Post by: Warrior on July 28, 2006, 08:38:06 pm
Update!

Wrote a lot of the engine logic today. I wrote a SceneManager (Much like Irrlicht) which accepts multiple Scene Nodes which can be anything. Basically the whole scene is a hierarchy of Scene Nodes with one Root node.

Currently I allow you to set anything as the root node but for fun I prewrote a "World Node" which inherits SceneNode and allows for things like creating SkyBoxes/Domes/Planes and will allow for other things later.

Tomorrow I plan to finish testing out my MeshNode and see if I can abstract it to allow loading of atleast .x and .3ds .
Title: Re: RTS Type Game
Post by: Warrior on July 29, 2006, 12:15:52 pm
Fixed Windowed Mode rendering and finished up the SceneNode/SceneManager completely.

Code: [Select]
using Ravage3D;

namespace Ravage3DTest
{
    public partial class Form1 : Form
    {
        Ravage3D.Device GameDevice = null;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            GameDevice = new Ravage3D.Device();
            GameDevice.InitDevice(this.Handle, true);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            GameDevice.BeginRendering();
                // Add code here kthx
            GameDevice.EndRendering();

            base.OnPaint(e);
        }
    }
}

I still have to implement some more things before I can show something useful but I'll try to get atleast primitives to be drawn by Node to show that off.
Title: Re: RTS Type Game
Post by: Warrior on July 29, 2006, 05:29:27 pm
Update!

This isn't really an engine fix more like me doing something wrong in Ravage3DTest

Code: [Select]
using System;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;

using Ravage3D;

namespace Ravage3DTest
{
    public partial class Form1 : Form
    {
        Ravage3D.Device GameDevice = null;

        public Form1()
        {
            InitializeComponent();
        }

        public void Form1_Load(object sender, EventArgs e)
        {
            GameDevice = new Ravage3D.Device();
            GameDevice.InitDevice(this.pictureBox1.Handle, true);
            Thread t = new Thread(new ThreadStart(this.Render));
            t.Start();
        }

        public void Render()
        {
            while (true)
            {
                GameDevice.BeginRendering();
                GameDevice.EndRendering();
            }
         }
    }
}

Using the above code you can render to any .NET control!
Title: Re: RTS Type Game
Post by: MyndFyre on July 31, 2006, 03:22:46 pm
Using the above code you can render to any .NET control!
Woot, here I come ToolStripMenuItem!!!!
Title: Re: RTS Type Game
Post by: Warrior on July 31, 2006, 04:16:14 pm
I hope.
Title: Re: RTS Type Game
Post by: Warrior on July 31, 2006, 04:20:03 pm
For some wierd reason Microsoft.DirectX.Direct3DX is throwing a NullReferenceException..my DLL compiles fine just at run-time it throws that error..odd.

Edit: I seemed to trace it down to:

this.OverlaySprite.Begin(Microsoft.DirectX.Direct3D.SpriteFlags.AlphaBlend);

and

this.OverlaySprite.End();

Throwing NullReferenceExceptions.
Title: Re: RTS Type Game
Post by: Warrior on July 31, 2006, 04:53:54 pm
Update!

Fixed the error and implemented font drawing!

Code: [Select]
using System;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Drawing;

using Ravage3D;

namespace Ravage3DTest
{
    public partial class Form1 : Form
    {
        Ravage3D.Device GameDevice = null;
       
        public Form1()
        {
            InitializeComponent();
        }

        public void Form1_Load(object sender, EventArgs e)
        {
            GameDevice = new Ravage3D.Device();
            GameDevice.InitDevice(this.pictureBox1.Handle, true, this.pictureBox1.Width, this.pictureBox1.Height);
           
            Thread t = new Thread(new ThreadStart(this.Render));
            t.Start();
        }

        public void Render()
        {
            while (true)
            {
                GameDevice.BeginRendering();
                    GameDevice.EngineOverlay.PrintText("Arial", 20, 60, 60, FontStyle.Italic, "Testing fonts!", Color.White);
                GameDevice.EndRendering();
            }
         }
    }

}

Currently, the engine doesn't check for any types of error nor does it even exit graciously. The next update will probably include me implementing handlers for those sorts of errors as well as handling the LostDevice exception.

Screenshot:

(http://img252.imageshack.us/img252/4681/ravage3dtextkv9.png)

The current code for the Overlay.cs is

Code: [Select]
using System;
using System.Collections;
using System.Text;
using System.Drawing;

using System.Windows.Forms;

using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
   
namespace Ravage3D
{
    public class Overlay
    {
        public Ravage3D.Device EngineDevice = null;
        public ArrayList OverlayFonts = null;
     
        public Overlay(Ravage3D.Device Dev)
        {
            this.EngineDevice = Dev;
            this.OverlayFonts = new ArrayList();
        }

        public void PrintText(String TextFont, float TextSize, Int32 X, Int32 Y, System.Drawing.FontStyle TextStyle, String Text, System.Drawing.Color TextColor)
        {
            System.Drawing.Font tempFont = new System.Drawing.Font(TextFont, TextSize, TextStyle);

            OverlayTextC tmpText = new OverlayTextC();
            tmpText.OverlayText = Text;
            tmpText.OverlayColor = TextColor;
            tmpText.XPos = X;
            tmpText.YPos = Y;

            tmpText.OverlayFont = new Microsoft.DirectX.Direct3D.Font(this.EngineDevice.EngineDevice, tempFont);

            OverlayFonts.Add(tmpText);
        }

        public void OverlayRender()
        {
            Microsoft.DirectX.Direct3D.Sprite OverlaySprite2 = new Microsoft.DirectX.Direct3D.Sprite(this.EngineDevice.EngineDevice);
            OverlaySprite2.Begin(Microsoft.DirectX.Direct3D.SpriteFlags.AlphaBlend);
           
            foreach (OverlayTextC t in OverlayFonts)
            {
         //       Rectangle tmpRect = new Rectangle(t.XPos, t.YPos, this.EngineDevice.Width, this.EngineDevice.Height);
                t.OverlayFont.DrawText(OverlaySprite2, t.OverlayText, t.XPos, t.YPos, t.OverlayColor.ToArgb());
            }

            OverlaySprite2.End();


            OverlayFonts.Clear();
        }
    }

    public class OverlayTextC
    {
        public Int32 XPos;
        public Int32 YPos;
        public String OverlayText;
        public System.Drawing.Color OverlayColor;

        public Microsoft.DirectX.Direct3D.Font OverlayFont;
    }
}

I don't know how pretty/ugly this is since I'm not a .NET guru so comments are very much appreciated.
Title: Re: RTS Type Game
Post by: MyndFyre on July 31, 2006, 05:11:00 pm
For some wierd reason Microsoft.DirectX.Direct3DX is throwing a NullReferenceException..my DLL compiles fine just at run-time it throws that error..odd.

For reference, the compiler can't predict EVERY ERROR that you would ever generate.  Otherwise there would be no such things as bugs.

A NullReferenceException is generated when you're trying to use a reference type (a class object) that has no value (it's like a null pointer) and you call a method or property on it.
Title: Re: RTS Type Game
Post by: Warrior on July 31, 2006, 05:11:55 pm
I fixed it by just making it a local var, it was odd I was declaring it in my constructor as the type.
Title: Re: RTS Type Game
Post by: Warrior on July 31, 2006, 07:47:12 pm
Update!

Tested some Node stuff with the new printing code which led me to the conclusion that my design sucks.

The new design which I'll code in tomorrow will feature a Node class which has built in functions for adding onto it and it manages it's own ID's and such as opposed to the previous design via SceneManager..only thing that SceneManager (or Ravage3D.RavageSM) will be good for is adding the Root Node and changing it. Maybe some other functions but that's mostly it.
Title: Re: RTS Type Game
Post by: Warrior on August 02, 2006, 04:08:52 pm
Update!

Implemented the new node system!

(http://img188.imageshack.us/img188/8458/ravage3dnodetestnq6.png)
Title: Re: RTS Type Game
Post by: MyndFyre on August 02, 2006, 04:35:35 pm
So, it took you all that time just to write text, when I've been doing it (http://www.jinxbot.net/wikimages/f/f8/Patched-tooltips.PNG) for a long time, *and* I have sweet-ass tool tips (http://www.jinxbot.net/wikimages/8/80/Thunderfury-with-gold-icons.PNG), and yet *I* suck?  PH33R!
Title: Re: RTS Type Game
Post by: Warrior on August 02, 2006, 05:21:48 pm
So, it took you all that time just to write text, when I've been doing it (http://www.jinxbot.net/wikimages/f/f8/Patched-tooltips.PNG) for a long time, *and* I have sweet-ass tool tips (http://www.jinxbot.net/wikimages/8/80/Thunderfury-with-gold-icons.PNG), and yet *I* suck?  PH33R!

Nah most of the time was design and making the actual text printing fit into the design, theres more behind the scenes than that. Also let's not forget to mention the SceneNode system which can be extended to include Meshes, Lights, Animations, and Cameras in the future.
Title: Re: RTS Type Game
Post by: Sidoh on August 02, 2006, 06:40:37 pm
(http://img188.imageshack.us/img188/8458/ravage3dnodetestnq6.png)

:(
Title: Re: RTS Type Game
Post by: Blaze on August 04, 2006, 04:21:25 pm
(http://img188.imageshack.us/img188/8458/ravage3dnodetestnq6.png)

:(

At least he cares enough to say how much he doesn't care.  Just think of the feelings of the people he didn't mention! :)
Title: Re: RTS Type Game
Post by: zorm on August 05, 2006, 04:36:12 pm
So, it took you all that time just to write text, when I've been doing it (http://www.jinxbot.net/wikimages/f/f8/Patched-tooltips.PNG) for a long time, *and* I have sweet-ass tool tips (http://www.jinxbot.net/wikimages/8/80/Thunderfury-with-gold-icons.PNG), and yet *I* suck?  PH33R!
I like how you took the time to black out the names of the characters but then totally missed the "Diaris on Illidan" on the tab.
Title: Re: RTS Type Game
Post by: MyndFyre on August 06, 2006, 09:13:39 pm
So, it took you all that time just to write text, when I've been doing it (http://www.jinxbot.net/wikimages/f/f8/Patched-tooltips.PNG) for a long time, *and* I have sweet-ass tool tips (http://www.jinxbot.net/wikimages/8/80/Thunderfury-with-gold-icons.PNG), and yet *I* suck?  PH33R!
I like how you took the time to black out the names of the characters but then totally missed the "Diaris on Illidan" on the tab.

Yeah, but to my knowledge there isn't a character named Diaris on Illidan.  The tab names are arbitrary.
Title: Re: RTS Type Game
Post by: Warrior on August 22, 2006, 06:56:36 pm
Made some small progress since then but I'm not home. Basically I restructured how most of it works to make it more flexible in the longrun. The engine has been renamed Nova Engine and can draw primitives using Vertex Buffers and I'm working on automatically managing lights in a scene which would pave the road for me adding meshes.

I've also been keeping an eye on the XNA framework and may restart the renderer to comply with that.