#141302 - yellowstar - Sun Sep 23, 2007 10:24 pm
I am working on a 3D multiplayer game.
(titled Star Fox Battle)
(Right now, I haven't gotten to the actual game,
or the online play, yet, but I will later)
(It's a PC game right now,
but I am going to port it later.)
(Yes, I know Wii homebrew isn't possible right now)
For a discription of the game, click here.
For the post about AI,(computers)
in the game, click here.
Goto the most recent post for the current problems, issues,
ect.
Anyway,
Here's my question:
Would I have any problems,
with doing online play,
on the above platforms?(in the title)
EDIT:
By over differen't platforms,
I meant some players could be
on differen't platform(s),
in each session.
So, one player could be on PC,
another on DS,
and another could possibly,(once Wii HB happens)
be on Wii.
Last edited by yellowstar on Fri Dec 07, 2007 12:46 am; edited 13 times in total
#141306 - Lick - Sun Sep 23, 2007 10:58 pm
Well, technically behind-the-scenes, no. But if you mean player advantages/disadvantages then anyone can think of obvious difficulties.
_________________
http://licklick.wordpress.com
#141322 - spinal_cord - Mon Sep 24, 2007 2:36 am
I hope you do well with this project, I would love to see a multi-platform multi-player game.
[slightly off topic]
Another thing I would like to see would be the same game on two different platforms (perhaps with graphic differences, showing the power each platform has) but have the save data the same format, so you can play perhaps a PC version of a game, copy the save data to the nds card then continue playing on the move.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#141340 - melw - Mon Sep 24, 2007 7:46 am
Well, yes no homebrew for Wii (besides Gamecube support) right now.
Besides that, why not? If you can pull out equivalent support in features on each platform there's nothing to stop you. DSWiFi library gives you similar possibilities as using Berkeley sockets on Linux/OSX or Winsock on PC Windows. You should perhaps consider not doing strictly realtime games with cross-platform in mind as framerates, network speeds, control methods etc. vary from DS to available computers quite a bit.
#141416 - yellowstar - Tue Sep 25, 2007 3:32 am
Thanks!
@spinal_cord:
This game,(at first anyway)
is multiplayer only.
But, if I implement a save game
feature, that would be a good idea.
Before I port it to Wii,(when Wii HB happens)
I will port it to Gamecube.(Since the NGC dosen't support WiFi,
it won't have a online mode. Only a local mode.)
Later,
I am going to setup my own,
small, web site,
with a section for this game.
Here's another detail about this game:
Everything can be modified.
That is, you can create your own weapons,
levels, characters, Arwings/Wolfens, and more!
(For the Air vehicles,
that means you can create your own Air vehicle,
with its own model, sound, and code.
You can do similar things with the other stuff.
For weapons, you can make it do almost anything you want.)
Another detail:
There is a feature, called Bonus Packs.
These Bonus Packs are basicly packs of extra content.(This content is the
same content you can create for the game(see above))
Plus, these Bonus Packs can be created by anybody.
Also, all or some of the stuff in these packs can be unlocked.
That is, the player would need to play multiplayer,(or something
for it)
a certain number of times to unlock it.
Another thing:
Bonus Packs,
and their content,
can be deactivated.(Or whatever you want to call it)
In other words,
you can't use that content till it is activated.
At first,
you can only battle in Arwings/Wolfens.
The reason for this, is,
trying to implement pilot mode and
Landmaster,
would be difficult.
I will try to do that,
after I finish the Arwing/Wolfen mode,
and some other things.
(I have a model of the Arwing,
but, it isn't the SF: Assualt version, which I want.
I will use the one I have, unless
somebody makes one. And for the Wolfen, I don't have any
models.)
The reason why it is a multiplayer-only game, is,
the above.
I am not going to make a single-player story
mode,
with only a Arwing/Wolfen mode.
Last edited by yellowstar on Wed Sep 26, 2007 1:58 am; edited 1 time in total
#141458 - tepples - Tue Sep 25, 2007 8:17 pm
yellowstar wrote: |
The reason why it is a multiplayer-only game, is,
the above.
I am not going to make a single-player story
mode,
with only a Arwing/Wolfen mode. |
No bots? Or would those just be too hard to make?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#141464 - yellowstar - Tue Sep 25, 2007 10:20 pm
tepples wrote: |
yellowstar wrote: | The reason why it is a multiplayer-only game, is,
the above.
I am not going to make a single-player story
mode,
with only a Arwing/Wolfen mode. |
No bots? Or would those just be too hard to make? |
I could try.
But, I never made an AI bot
for a game like this, before.
I made AI for a few games,
but those were board games,
not action games, like this.
When I said no single player mode,
I meant no story mode.
<EDIT>
I forgot to mention something.
At first, the levels you battle in,
is completly empty.
This means you can't bang into anything,
other than the level's boundarys.
</EDIT>
For all the vehicles,
they can have custom code.
First, there is a interface DLL,
which passes data sent to it,
to the Driver.
Whenever a player,(human or computer)
wants to do an action,(like changing direction, shooting, ect.)
it passes the keys pressed,
to the Interface.
The Driver performs actions,
based on the data sent to it.
This data includes which keys were pressed.
This data is generic.
That is, when P1 pressed his up key,
the Driver and Interface
only know that the player pressed his up button.
The keycode is not sent, only which keys were pressed.
The Driver can do more.
It can do special effects for the actions.
It can preform these special effects at any time.
These actions are actions all the Drivers must have.
Like moving, changing direction,
special manuvers,((Arwings/Wolfens only)
Like Loop-the-Loop, and turning around, when
the plane leaves the level's boundarys)
shooting, dodging, ect.
In this way,
the vehicles can be handled
very easily.
#141646 - yellowstar - Thu Sep 27, 2007 11:32 pm
I have a new problem,
with porting.(I haven't started porting, this is a problem
I will run into, if not resolved before I start porting.)
This game uses DLLs.
Not only does it use them for customization,
it also uses them for the actual game.
(Engine, game states, ect.)
And, all the platforms
which it will be ported to,
don't support DLLs.(That I know of.)
I'm not taking customization out.
That's what this game is all about.
(Other than multiplayer and ect.)
The DLLs mainly use exported functions.
There are some DLLs,
called Helpers,
which export classes.
But, those don't change very often,
so they could be changed into static librarys.
#141648 - Dan2552 - Thu Sep 27, 2007 11:40 pm
can't you replicate the kind of things which the DLLs do in your own custom code?
#141652 - yellowstar - Thu Sep 27, 2007 11:47 pm
Dan2552 wrote: |
can't you replicate the kind of things which the DLLs do in your own custom code? |
No.
This game is all about customization.(with custom code)
And I can't have customization,
with custom code,
without DLLs.(or some other way of doing something similar.)
If you mean writing my own code
for handling DLLs,
I don't know much about that.
#141675 - Mighty Max - Fri Sep 28, 2007 5:12 am
yellowstar wrote: |
This game is all about customization.(with custom code)
And I can't have customization,
with custom code,
without DLLs.(or some other way of doing something similar.)
|
Sure you can, it's called open source.
_________________
GBAMP Multiboot
#141686 - melw - Fri Sep 28, 2007 9:13 am
Well, don't choose to use external libraries that are only available for Win32? Doing my own cross-platform engine (currently supporting Win32/Linux/OSX-PPC/OSX-Intel/NDS) I chose to use SDL library for graphics+input and FMOD lib for sounds - both have a wide range of supported platforms - only bits you need to code then on your own is the correspondent gfx/audio stuff for NDS (and GPF has also ported SDL for NDS, if you need/want to use SDL on DS).
Not getting into any specifics, but keeping things simple will help you a lot when doing cross-platform applications. Also, limit the program in such way what the DS can do, or at least by doing funky stuff on highend-PC's, don't cripple the DS version. Getting something working on PC that runs well on DS is a charm, doing it other way around will give you easily headaches.
#141687 - simonjhall - Fri Sep 28, 2007 9:20 am
Messing around with dynamically-loaded code at this stage would be a mistake - instead, design the interfaces to the code which can be dropped-in in a nice and clean way. That way you can statically link you program until it reaches a stable state, and only when you have the time to do dynamically-loaded code mess around with the complexities of doing this.
_________________
Big thanks to everyone who donated for Quake2
#141728 - yellowstar - Fri Sep 28, 2007 9:56 pm
Mighty Max wrote: |
yellowstar wrote: |
This game is all about customization.(with custom code)
And I can't have customization,
with custom code,
without DLLs.(or some other way of doing something similar.)
|
Sure you can, it's called open source. |
I wasn't thinking about that when I wrote that.
If I were to do it that way,
it would have to be rebuilt every time
when custom code is changed.
And, using custom code made
by other people,
and other code,
wouldn't be easy.
And I'd perfer to do it dynamiclly.
I guess,
once I start the porting,
I'll do what simon said.
#142142 - yellowstar - Fri Oct 05, 2007 1:57 am
This Project is going nowhere at the moment.
Click here for why.
If anybody wants to help,
post here, or PM me.
#142150 - simonjhall - Fri Oct 05, 2007 7:43 am
What is texID? Is it an int?
Because if so I'm pretty sure that Code: |
glGenTextures(1,tgaimage->texID);
glBindTexture(GL_TEXTURE_2D, *tgaimage->texID); |
isn't right. Shouldn't it be Code: |
glGenTextures(1,&tgaimage->texID);
glBindTexture(GL_TEXTURE_2D, tgaimage->texID); |
Also, the DS doesn't support 'OpenGL' in the same way that a PC may support OpenGL, so there are often differences between the two systems... (especially with texture co-ordinates)
_________________
Big thanks to everyone who donated for Quake2
#142167 - yellowstar - Fri Oct 05, 2007 5:42 pm
simonjhall wrote: |
What is texID? Is it an int?
|
It's an pointer to an unsigned int.
Code: |
unsigned int *texID;
|
It points to a local var in the LoadTexture
function.
The LoadTexture function returns the value
of this var.
#142188 - zeruda - Fri Oct 05, 2007 10:24 pm
Well, here's a tga texture loading class I made for PC, haven't ported it to DS though. The Create() function calls TGA_Texture function which calls Load TGA. You choose the texture ID yourself which is held in TextureArray[50] so they under your control. You access it by the array index(in this case 0 to 49). Each element is a UINT handled and managed by OpenGL, you don't need to worry about it, you just worry about the array index. In this case the create function loads 3 textures, into index 0, 7 and 31.
Code: |
#ifndef _TEXTURETGA_H
#define _TEXTURETGA_H
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <stdio.h>
#define TGA_RGB 2
#define TGA_A 3
#define TGA_RLE 10
class CTextureTGA
{
public:
void Create();
void TGA_Texture(UINT textureArray[], LPSTR strFileName, int textureID);
UINT TextureArray[50]; // Space for 50 texture IDs
private:
bool Load_TGA(const char *filename);
int tchannels;
int size_x;
int size_y;
unsigned char *data;
};
extern CTextureTGA TextureTGA;
#endif
|
Code: |
#include "TextureTGA.h"
// load the textures passing in the texture ID.
void CTextureTGA::Create()
{
TGA_Texture(TextureArray, "texture/woodtexture.tga", 0); // Load wood texture into TextureArray[0]
TGA_Texture(TextureArray, "texture/head.tga", 31); // Load head texture into TextureArray[31]
TGA_Texture(TextureArray, "texture/LeftShoulder.tga", 7);
}
void CTextureTGA::TGA_Texture(UINT textureArray[], LPSTR strFileName, int ID)
{
if(strFileName) {
if (Load_TGA(strFileName)) {
glGenTextures(1, &textureArray[ID]);
glBindTexture(GL_TEXTURE_2D, textureArray[ID]);
int textureType = GL_RGB;
if(tchannels == 4) { textureType = GL_RGBA; }
gluBuild2DMipmaps(GL_TEXTURE_2D, tchannels, size_x, size_y, textureType, GL_UNSIGNED_BYTE, data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
}
}
}
bool CTextureTGA::Load_TGA(const char *strfilename)
{
FILE *pFile = NULL;
WORD width = 0; WORD height = 0;
byte length = 0; byte imgType = 0; byte bits = 0;
int channels = 0; int stride = 0;
int i = 0;
if((pFile = fopen(strfilename, "rb")) == NULL) { return false; }
/////// READ IMAGE DATA ///////////////
fread(&length, sizeof(byte), 1, pFile);
fseek(pFile,1,SEEK_CUR);
fread(&imgType, sizeof(byte), 1, pFile);
fseek(pFile, 9, SEEK_CUR);
fread(&width, sizeof(WORD), 1, pFile);
fread(&height, sizeof(WORD), 1, pFile);
fread(&bits, sizeof(byte), 1, pFile);
fseek(pFile, length + 1, SEEK_CUR);
if(imgType != TGA_RLE) {
// Check for 24 or 32 Bit
if(bits == 24 || bits == 32) {
channels = bits / 8;
stride = channels * width;
data = new unsigned char[stride * height];
for(int y = 0; y < height; y++) {
unsigned char *pLine = &(data[stride * y]);
fread(pLine, stride, 1, pFile);
for(i = 0; i < stride; i += channels) {
int temp = pLine[i];
pLine[i] = pLine[i + 2];
pLine[i + 2] = temp;
}
}
} else if(bits == 16) {
unsigned short pixels = 0;
int r=0, g=0, b=0;
channels = 3;
stride = channels * width;
data = new unsigned char[stride * height];
for(int i = 0; i < width*height; i++) {
fread(&pixels, sizeof(unsigned short), 1, pFile);
b = (pixels & 0x1f) << 3;
g = ((pixels >> 5) & 0x1f) << 3;
r = ((pixels >> 10) & 0x1f) << 3;
data[i * 3 + 0] = r;
data[i * 3 + 1] = g;
data[i * 3 + 2] = b;
}
} else {
return false;
}
} else {
byte rleID = 0;
int colorsRead = 0;
channels = bits / 8;
stride = channels * width;
data = new unsigned char[stride * height];
byte *pColors = new byte [channels];
while(i < width*height) {
fread(&rleID, sizeof(byte), 1, pFile);
if(rleID < 128) {
rleID++;
while(rleID) {
fread(pColors, sizeof(byte) * channels, 1, pFile);
data[colorsRead + 0] = pColors[2];
data[colorsRead + 1] = pColors[1];
data[colorsRead + 2] = pColors[0];
if(bits == 32) { data[colorsRead + 3] = pColors[3]; }
i++;
rleID--;
colorsRead += channels;
}
} else {
rleID -= 127;
fread(pColors, sizeof(byte) * channels, 1, pFile);
while(rleID) {
data[colorsRead + 0] = pColors[2];
data[colorsRead + 1] = pColors[1];
data[colorsRead + 2] = pColors[0];
if(bits == 32) { data[colorsRead + 3] = pColors[3]; }
i++;
rleID--;
colorsRead += channels;
}
}
}
}
fclose(pFile);
tchannels = channels;
size_x = width;
size_y = height;
return true;
} |
In your main.cpp or whatever you create an instance of the TextureTGA class. Then initialise it and call the create function. (you can get rid of this and just directly call the TGA_Texture function to load them within your code.)
Code: |
CTextureTGA TextureTGA;
bool Initialise () //Initialise OpenGL settings
{
glEnable (GL_TEXTURE_2D);
TextureTGA.Create();
}
|
Then you bind your textures as you need them.
Code: |
glBindTexture (GL_TEXTURE_2D, TextureTGA.TextureArray[7]);
DrawTriangle(); // Draw with Texture index 7
glBindTexture (GL_TEXTURE_2D, TextureTGA.TextureArray[31]);
DrawTriangle(); // Draw with Texture index 31
glBindTexture (GL_TEXTURE_2D, 0);
DrawTriangle(); // Draw without texture index(in other words without any texture at all)
glBindTexture (GL_TEXTURE_2D, TextureTGA.TextureArray[0]);
DrawTriangle(); // Draw with Texture index 0
|
#142190 - yellowstar - Fri Oct 05, 2007 10:58 pm
I have updated the actual topic.(the topic on gamedev)
yellowstar on gamedev wrote: |
I have found out why one of the values
was way to big.
It was a result of a mistake in some debugging code.
Now all of it is zero in all cases.
|
All the loaders I have tried to use
in this program wouldn't work.
And they work in the demo program
which comes with them.
It must be something other than
the texture creation and TGA loading.
#142320 - yellowstar - Mon Oct 08, 2007 2:52 am
I have updated the actual topic.(the topic on gamedev)
yellowstar on gamedev wrote: |
I have dumped the converted image,
and had it displayed in a seperate program.
It worked.
So,
the problem is the gl commands,
not the loading code.
That is,
the texture creation gl function calls.
But,
that code is correct.
It works in other programs.
So,
something must be messing it up.
|
#143386 - yellowstar - Sat Oct 20, 2007 5:35 pm
I have updated the actual topic.
yellowstar on gamedev wrote: |
I have Solved it!!!!(the texture problem)
I found the problem via a debugger mentioned
in my Ogl debugger topic.(GLintercept)
(Basic settings found it.)
Here,
I was doing ogl init,(enabling textures)
and creating textures,
BEFORE the window and ogl context was created!(Window creation and ect.
was in a function similar to main.
I moved that into a seperate function.)
Once I did the stuff mentioned in the parentheses,
it worked!!!
The colors and ect.
weren't correct.
But,
that's my TGA loader causing that.
I should be able to fix it.
If not,
I'll post here.
I'm having another problem.
On my computer,(tested on XP, works on my 98)
when I exit the program,
it throws the following error:(similar to it)
'The instruction at address 0x7c910f29 refrenced memory at address 0x00000000
The memory could not be "read" '
Click here(link removed)
if you want to help with this problem.
|
link:
http://www.gamedev.net/community/forums/topic.asp?topic_id=469011
(for some reason, I couldn't get the the url tag to work right,
so I just posted the url.)
I have decided to stop posting here,
about PC problems for this game.
I will post here,
later, about
porting problems.
However,
I will edit this post,
or a differen't post,
to let anybody that reads this,
know about
updates, current developments,
and bugs, and ect.
Also,
I will still post here about concepts for this game.
(more features in this game,
more info about this game, and ect.)
For Multiplayer,
there will be an mode called local.
For PC,
this means playing split-screen.
Also,
there will a option inwhich you can
play with people over your network.
You don't have to use the options.
Also,
you can also disable the main mode
and use only the options.
Like, on PC,
play on only the network.
Also,
there are devices,(the platforms being played on,i.e. PC,DS,Wii,ect.)
which can act as stations.
These stations,
act as a device which communicates
with other devices,
via the options.
The stations
are basicly servers,
which are connected to another server.
So,
a DS which acts as a station,
would send and receive messages to and from it's
server, and forward the messages sent to it,
to it's server,
and the messages sent to it from it's server,
to it's clients.
For example,(see below)
In a DS-Wii battle,
one DS could communicate with
other DSes, and possiblely with other
Wiis, if wanted.
For DS,
local means local wireless multiplayer.(once the lib is ready)
Also,(once Wii HB happens, and when we crack the WiFi and local wireless)
the DS could have multiplayer play
with the Wii,
over local wireless.
For Wii,
local means split-screen multiplayer.
Also,
it could have Wii-DS comms.
So,
the Wii could communicate with other Wiis,
and with DSes.(both could act as stations.)
For NGC,
local mode means only split-screen multiplayer.
No local wireless or WiFi,
since the NGC dosen't have such things.
This mode,
and all additional options,(All of the stuff mentioned for multiplayer above)
can be used in online play.
So,
it would be possible,
for all platforms,(except NGC)
to play together,
locally.
And,
they could use WiFi to connect together if needed.
Is the above ideas feasible?(the ideas about stations,
and connecting them through WiFi.)
That is,
would there be slow-downs, lag, ect?
If so,
would there be ways to fix it,
or minimalize them?
#143388 - yellowstar - Sat Oct 20, 2007 5:58 pm
If anybody has any ideas,
please go ahead and post.(if you want, PM me)
(I already have lots of ideas,
but I welcome more.)
Note that,
once I get to the porting point,
please confine the ideas to PMs to me.(no posting about ideas
for the game, just dev at that point.(PM me instead about ideas))
#143390 - melw - Sat Oct 20, 2007 6:09 pm
You do have big plans and at least lack of ambition isn't going to be a problem. However, I'd strongly suggest you get your engine and framework finished (or at least somewhat working) before getting too much into time consuming details. What you're describing here is easily months of work even for an experienced programmer.
Easiest thing is to get first a game running on PC and keeping in mind the other platforms when it comes to visual assets, input, sounds, networking and performance. Debugging and testing on PC is also whole lot easier than on any other platform.
Good luck!
#143391 - yellowstar - Sat Oct 20, 2007 6:17 pm
I'm not going to try to start implementing multiplayer and the other ideas
untill after I get the Engine and ect. to work correctly.
#145468 - yellowstar - Fri Nov 16, 2007 2:25 am
The following isn't a DS-related
Question,
but,
since there are people here that
don't use Windows,
I thought I'd ask it here.
Is it possible to compile Non-Windows(the running OS)
programs,(libs, DLLs, and exes)
on a Windows PC?(I'm not starting porting right now.)
(I was going to release my FCopy app,
but it only works on Windows.)
(And not everybody uses Windows.)
For example,
compiling a Linux program
on Windows.
I'm using Dev-Cpp.
If not,
I would have to find
some people to compile(and test)
it.
EDIT:
I didn't remember how
hard it is to keep systems in sync in networking,
when I started Pong,
and when I decided to implement that in this game.
(I read about that before,
but never could try it until Pong.)
I'm going to need lots of practice
before I implement networking in this game.
#145522 - tepples - Sat Nov 17, 2007 4:30 am
If you are compiling for GNU/Linux, you will need to test on GNU/Linux. You could always use Microsoft Virtual PC to run Xubuntu inside Windows.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#145552 - yellowstar - Sat Nov 17, 2007 8:18 pm
What exactly is Xubuntu?
When I googled,
most the entries said it is an OS.
What is the whole
list of the OSes
that Windows Virtual PC
can emulate?(or whatever it's called)
(The only non-Windows OS on the list,
was OS/2)
#145554 - tepples - Sat Nov 17, 2007 8:51 pm
I was using Xubuntu as an example of a lightweight GNU/Linux based operating system.
Microsoft Virtual PC software emulates several operating systems. Microsoft does not provide technical support for all of them. But GNU/Linux does work.
You might also have luck with VMware.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#145662 - yellowstar - Tue Nov 20, 2007 3:57 am
So,
If I would use Virtual PC,(or some other virtualization software)
with Linux installed,
could I compile Linux programs?(with GNU/Linux)
#145665 - tepples - Tue Nov 20, 2007 4:04 am
Yes.
I'm not guaranteeing, but I'm at least 90 percent sure that if you install a Linux OS inside a sufficiently large virtual machine, you'll be able to compile and test programs inside the virtual machine.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#145666 - yellowstar - Tue Nov 20, 2007 4:10 am
When installing a OS with Virtual PC,
is it the actual OS?
That is,
does it include all the files and ect,
when installing an OS?(That is,
is it similar to the files of the real OS)
Or, is it emulated,
with a small filesize?
#145667 - tepples - Tue Nov 20, 2007 4:36 am
yellowstar wrote: |
When installing a OS with Virtual PC,
is it the actual OS?
That is,
does it include all the files and ect,
when installing an OS?(That is,
is it similar to the files of the real OS) |
Yes.
Quote: |
Or, is it emulated,
with a small filesize? |
There are large distributions of Linux, and there are small distributions of Linux. If you choose a small distro, it will be small inside the VM. If you choose a large distro, it will be large inside the VM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#145669 - yellowstar - Tue Nov 20, 2007 4:52 am
I'd go with small.
What is the size of the small version?
#146041 - yellowstar - Tue Nov 27, 2007 10:57 pm
I have decided to add support for additional input devices.(PC)
I'm going to add Wiimote support.
(This would be difficult to develop.
This is because I don't have a Wii/wiimote.
My relative has it.)
Also, I might add Joystick support.
(I'd have to find Joystick testers,
as only my old 98 has a port for that,
and it crashed the last time I tried to use Joysticks on it.)
EDIT:
Another thing:
Like everything else,
programmers can create their own Input Device Drivers.
(DLLs which handle input, like Wiimote, Joystick, Keyboard, ect.)
#146165 - yellowstar - Thu Nov 29, 2007 11:43 pm
I have figured out a way
to easily switch between DLLs and static libs.
There wouldn't be any exported functions.
Instead,
there would be a exported function
which returns the addresses of the
functions.(in a struct)
The host of the lib/DLL
would call that exported function,
and then store the function pointers,
to be used later.
#146171 - simonjhall - Fri Nov 30, 2007 12:40 am
How will you build these libraries? If they're to be standalone files then you're probably gonna need a special linker script...
_________________
Big thanks to everyone who donated for Quake2
#146238 - yellowstar - Fri Nov 30, 2007 11:45 pm
I would manually switch between DLL and static lib.
(Shouldn't be to hard)
(It would be great if I could build both at once.)
(Or convert/switch between both easily)
I was using static librarys for the modules
when I first started this project,
but that didn't work with the way I was doing it.
(I switched to DLLs after that)
#146257 - yellowstar - Sat Dec 01, 2007 4:52 pm
This idea works.
I just need to get the engine working with this.
(I have only tested it with DLLs)
I'm going to add a way to
easily switch between DLL and static libs.
All I'd have to do,
once done, is:
define/undefine a define,
add/remove some included headers,
and add/remove the static library version of the modules.
(and, of course, rebuild the modules if needed.)
I think I figured out why
this game is crashing when
I exit it on my WinXP.
I think I'm
freeing the modules,
before I'm completely done with them.
There's
some function calls,
in the Shell,
which call DeInit functions in the modules.
(When quitting)
These functions seem to be called
after the DLLs are freed.
(It's odd that this isn't causing problems on my Win98)
(The above comment is only valid,
of course, if the above idea is the problem.)
EDIT:
Well,
the above idea about the crashes on WinXP
failed.
The function that frees the DLLs isn't
being called at all.
#146278 - yellowstar - Sat Dec 01, 2007 10:17 pm
I'm having strange problems,
with this new idea.(for getting the addresses of the functions.)
For some reason,
the GetFunctions function in the Game
module seems to be returning 0.
(It's supposed to be the address
of some arbitary data.)
Eventually,
this causes a crash.
I'm still trying to find the problem.
#146327 - yellowstar - Sun Dec 02, 2007 9:08 pm
I have found one bug that was causing problems.
The index value passed to my functions
which handle module loading(which has the above problem)
was hard-coded.(Apparently, I forgot to fix
that after I added the defines for that)
(With the wrong values.)
But,
it's still crashing.
I have a void* array,
for this.
I tried changing it to an array struct
which contains a void* var,
but it still won't work.
For some reason,
the only value that
get's done correctly,
is always the same.
They seem to always write to the
same index.(with the same value.)
EDIT:
Never mind out the above
about the values of the array.
I was using Dev-Cpp's debugger for this.
The debug output from my game,
for these addresses, seemed fine.
Any idea what's going on???
#146630 - yellowstar - Fri Dec 07, 2007 12:45 am
I have solved this strange crash.
The function pointers for one of modules
was null.(not initialized correctly.)
yellowstar on gamedev wrote: |
Solved!
The indexes for the renderStates var
was supposed to be zero-based.
Instead,
they were one-based.
There are only 2 indexes in
the renderStates array,(the array that this var points to)
for modules.
One module's index was out of bounds.
This meant that module's function pointers
didn't get touched.
(That would have caused another crash,
if it weren't for some data after this array.)
Once I fixed this,
it worked.
|