Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ahobday
Apr 19, 2007

Pope Ron Paul II posted:

Actually, I haven't. I found that particular forum, but I didn't find that mod or program he's using. Thanks for finding it! It's worth a shot. I have no guarantee that the animations for things like water or waving trees will work, but I'll try. I might post results if I get it to work the way I like.

Just a worry I have. If I use this and edit the grasslands for example, I'm worried that it might not look like a contiguous field: that it might look choppy because of where the square for the basic 1x1 texture picture ends.

I'm sure the devs handled that by making the textures tile well. Then again, looking at the screenshot, those textures aren't particularly contiguous anyway.

Adbot
ADBOT LOVES YOU

Pope Ron Paul II
Feb 10, 2008
GodTube Ron Paul?

Centipeed posted:

I'm sure the devs handled that by making the textures tile well. Then again, looking at the screenshot, those textures aren't particularly contiguous anyway.

Well, good news! I can actually edit these textures. The way it ended up playing out was I opened whatever animation I needed with that program, and then I had to take a bitmap to replace the individual tiles with. Essentially it means hours and hours of cutting and pasting potential texture files of water, grass, trees, and whatever else. But that entails literally hundreds of files. It's going to take a ridiculous amount of work to do it. If I get this to work and to look nice, this will be one hell of a mod. Like I said though, finding replacement bitmaps and replacing every individual tile is going to take days, weeks, even months.

Oh well. At least it works. Thanks very much for the help.

i am not zach
Apr 16, 2007

by Ozmaugh
I know this is a really broad question, but how exactly do MUDs work? I was looking at trying to make one, but it seems that the newest codebases are still 6-7 years old. What exactly would go into making a new one?

SlightlyMadman
Jan 14, 2005

i am not zach posted:

I know this is a really broad question, but how exactly do MUDs work? I was looking at trying to make one, but it seems that the newest codebases are still 6-7 years old. What exactly would go into making a new one?

There's actually a large MUD industry that's in very active development, they just started adding 3D graphics to them and calling them MMORPGs.

Seriously though, people do still play classic MUDs, but as far as I know they mostly still use the old codebases (many of which are a lot more than 6-7 years old). Why would they change them, and why can't you use one of the old ones?

edit: By the way, I don't know how much game programming experience you have, but you might have better luck starting out with a simpler project, like a Roguelike. These can be easily written from scratch in just a few days, and if you have a specific game idea in mind it would be a good place to flesh out your ideas in single player.

SlightlyMadman fucked around with this message at 16:11 on Jun 24, 2009

Walked
Apr 14, 2003

Can anyone point me in the right direction? I'm playing with XNA and want to put together a 2d-sidescroller.

I assume I cannot hand-draw the maps and load the whole map into memory, that would result in a giant texture.

As such, I assume tile-based is the way to go. Are there any resources abound that can walk me through the basics of this? Ideally I'm unsure how to handle the scrolling of the level (moving the character / level in relation to eachother), and how to handle loading / unloading textures when theyre not drawn.

Not looking to have something handed to me, and it doesnt need to be XNA, just a general theory writeup of what I should / should not be doing.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

i am not zach posted:

I know this is a really broad question, but how exactly do MUDs work? I was looking at trying to make one, but it seems that the newest codebases are still 6-7 years old. What exactly would go into making a new one?
I highly recommend looking at the CircleMUD code; it's what you're looking for and is very easy (and enjoyable!) to read, so much so that I use it as a benchmark for deciding the quality of other open source code I read. It doesn't matter so much whether the code is old or not, there's still a lot you can learn from this 15 year old program.

Now, something else to consider is whether you want to tackle writing a new codebase from scratch or simply use an existing one to create a new world, new monsters, etc. It all depends on what you're interested in; personally, I find that the programming aspect is more fun than the "game design" aspect, so for that reason I've gone with the former rather than the latter, but your milage may vary.


SlightlyMadman posted:

edit: By the way, I don't know how much game programming experience you have, but you might have better luck starting out with a simpler project, like a Roguelike. These can be easily written from scratch in just a few days, and if you have a specific game idea in mind it would be a good place to flesh out your ideas in single player.
Funny you should mention this, my current project is a roguelike MUD :cool: But yeah, if you're not comfortable with sockets programming, you might want to learn more or start with a smaller project.

SlightlyMadman
Jan 14, 2005

Dijkstracula posted:

Funny you should mention this, my current project is a roguelike MUD :cool: But yeah, if you're not comfortable with sockets programming, you might want to learn more or start with a smaller project.

Okay, that looks drat cool. Can you tell me any more about it, or is it still in the POC stages?

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

SlightlyMadman posted:

Okay, that looks drat cool. Can you tell me any more about it, or is it still in the POC stages?
Thanks. :) I've only been working on it the weekends this summer so it's not very far along. However, the network layer and ANSI text frontend (it all communicates over telnet, so learning how IAC behaves and handing terminal window resizing, echoing, etc, was a big hurdle at the beginning) is mostly complete. I'm finishing up a simple parser and will probably start on event handling this weekend, now that I have an idea in my head how I want to approach it. (I was tempted to create a MOO-style interpreted language for it, but quickly decided that that would be far more work than it's probably worth)

Walked
Apr 14, 2003

Question about something:
edit: XNA & C#

I've got a 3d array right now, this way I can get an X, Y, and a pair of values out of the array - for putting a tile map together. (The idea is to allow for two tiles per square, a ground tile & worldobject tile).

I'm trying to figure out how to parse this from a string so I can manually craft "maps" in Notepad.

I am fine with the following format:

code:
map = new int[,,]
            {
                {{3, 0}, {3, 0}, {3, 0}, {1, 0}, {1, 0}, {1, 0}},
                {{3, 0}, {3, 0}, {3, 0}, {3, 0}, {3, 0}, {1, 7}},
                {{2, 0}, {3, 0}, {2, 0}, {1, 0}, {1, 0}, {1, 0}}
            }

Which is precisely how I got things working putting a "map" together by hand.

I cannot for the life of me figure out how to parse a string containing:
code:
                {{3, 0}, {3, 0}, {3, 0}, {1, 0}, {1, 0}, {1, 0}},
                {{3, 0}, {3, 0}, {3, 0}, {3, 0}, {3, 0}, {1, 7}},
                {{2, 0}, {3, 0}, {2, 0}, {1, 0}, {1, 0}, {1, 0}}
Into a usable 3d Array.

Any ideas? Not looking for an answer on a silver platter, just something to run with, perhaps a collection type or method I'm missing somewhere.

Contains Acetone
Aug 22, 2004
DROP IN ANY US MAILBOX, POST PAID BY SECUR-A-KEY

Contains Acetone fucked around with this message at 18:14 on Jun 24, 2020

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Walked posted:

Any ideas? Not looking for an answer on a silver platter, just something to run with, perhaps a collection type or method I'm missing somewhere.

Get a parser generator and just write up the grammar. The grammar should be pretty straightforward and concise, and using a parser generator means you won't write in a ton of parsing bugs.

nibe
Feb 23, 2008

Contains Acetone posted:

Use nested for loops and a counter. Count up whenever it counts a left bracket and count down every right bracket. Then use conditionals to parse the characters depending on the value of the counter. You could do it dynamically with a list or you could do two passes (first time to figure out the lengths of each array, second to get the actual values) to store in an array.
You could just put the number of rows and columns at the top of the file, and get rid of the brackets and commas. Read in the rows and columns and initialize the array, then use for loops that fill it up without conditionals.

huge sesh
Jun 9, 2008

Does anyone know what's involved with the client authentication part of a multiplayer game? Apparently openssl supports ssl over udp as of 0.9.8, but it lacks documentation (that I can find). I'd as soon use boost::asio (which supports ssl), but none of their examples use it on a datagram socket.

Or am I thinking about this wrong? It seems like it would be easy to spoof another player's packets if I don't implement some kind of encryption.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

huge sesh posted:

Or am I thinking about this wrong? It seems like it would be easy to spoof another player's packets if I don't implement some kind of encryption.
Have the server give the client a session ID, sending the session ID with each UDP packet, and making sure the session ID and IP match up.

If you're REALLY concerned with authenticity and interception, public key encryption's pretty straightforward:
- Side A generates a symmetric encryption key
- Side B sends side A a public key
- Side A encrypts the symmetric key using the public key and sends it to side B
- Side B decrypts the symmetric key using its private key

Both sides now have the symmetric key, anyone monitoring the traffic doesn't, and you can safely encrypt traffic between them. Of course, it's a game, so the odds of somebody trying to spoof packets is really, really low unless you're some super-popular MMO and they're trying to steal your poo poo to eBay it, in which case they still won't do it because it's easier to spam virus links and hijack infected PCs to do it.

OneEightHundred fucked around with this message at 05:34 on Jun 29, 2009

huge sesh
Jun 9, 2008

Could you tell me a specific library to do this with? I'm really out of my depth when it comes to encryption. Baby steps here.

Also I'm a little worried about people attacking the client's key. Clients will be sending packets whose plaintext contents can be easily guessed (simply by observing the player's ingame actions) and will be frequently be repeated. Further, the client is open source so there is no obscurity barrier at all (part of why I'm paranoid about this). I guess I could force the client to generate new keys regularly but I have no idea what the bounds on that should be.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Step 1) Write a network protocol
...
Step 1,000) Worry about encryption

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

huge sesh posted:

Could you tell me a specific library to do this with? I'm really out of my depth when it comes to encryption. Baby steps here.
There are countless libraries that implement RSA for public key encryption. For the symmetric encryption you can use practically anything, use Blowfish if you're really interested in security, if not just XOR the packets against the key.

quote:

Also I'm a little worried about people attacking the client's key. Clients will be sending packets whose plaintext contents can be easily guessed (simply by observing the player's ingame actions) and will be frequently be repeated.
Encryption isn't about making an unbreakable communication system, it's about making it require more effort than anyone's going to bother spending on it. For a game, that amount of effort is microscopic.

You can be almost completely certain that, if the packets are coming from an IP address, they are coming from the same network. Session IDs will allow you to distinguish between multiple computers on the same network.

At that point, spoofing packets requires at the very least sniffing out packets from players to get the session ID, which is far more effort than anyone's going to bother spending on it.

slovach
Oct 6, 2005
Lennie Fuckin' Briscoe
As ancient as DirectDraw is, I curiously wondered what kind of speed gain I would get from porting my GDI code to it. It seemed straightforward enough, since all the effects like scaling / blending I wrote would be practically drag + drop, so I tried to throw something together that simply displays a pixel.

I ran into a problem though.

http://pastebin.com/m2fdb5923

The surface is clipped, but it is actually living at the top left corner of my screen? I have to move my window to there to actually see the pixel I draw. I don't get why. Any ideas?

Really, it's proven much more straightforward to get something onscreen in DX9 so far.


edit:
actually what the gently caress I figured it out myself. GetWindowRect() + Reading Blt parameters again = solved.

slovach fucked around with this message at 10:30 on Jun 30, 2009

Contains Acetone
Aug 22, 2004
DROP IN ANY US MAILBOX, POST PAID BY SECUR-A-KEY

Contains Acetone fucked around with this message at 18:14 on Jun 24, 2020

deadjb
Aug 11, 2002

I've got an interview for a game programming position coming up. I worked as a game programmer about a year ago, so the math isn't new to me. BUT, I really need to brush up on linear algebra stuff again, just to be able to answer any questions. Are there any solid overview sites available? I'm not really looking for proofs as much as just various cookbook-esqe pointers. Relationship between dot-product and angles / magnitude, etc.

I've googled around, but so far all I've found is wikibooks. If this is already in this thread, then I'm sorry. I looked around but couldn't find a solid link. Apologies in advance.

TSDK
Nov 24, 2003

I got a wooden uploading this one

SkankerX posted:

I've got an interview for a game programming position coming up. I worked as a game programmer about a year ago, so the math isn't new to me. BUT, I really need to brush up on linear algebra stuff again, just to be able to answer any questions. Are there any solid overview sites available? I'm not really looking for proofs as much as just various cookbook-esqe pointers. Relationship between dot-product and angles / magnitude, etc.

I've googled around, but so far all I've found is wikibooks. If this is already in this thread, then I'm sorry. I looked around but couldn't find a solid link. Apologies in advance.
I generally find this site to be quite readable as a quick refresher for things like lines intersecting planes etc...:
http://softsurfer.com/algorithm_archive.htm

wlievens
Nov 26, 2006

Pfhreak posted:

Unfortunately we are using space ships with somewhat unusual contours. We've tested both AABB and circle based solutions, but as physics is a core component of the gameplay (lots of tugboat style maneuvers), we need slightly more accuracy. Honestly, in most cases, we could make due with 8-12 points (and in some cases fewer.) We've been doing them by hand by opening the image in photoshop, and clicking around to get our point list, but that's tedious in the extreme.

You could do a Convex Hull, that'd be a lot better than an AABB.

tyrelhill
Jul 30, 2006

wlievens posted:

You could do a Convex Hull, that'd be a lot better than an AABB.

Isn't that exactly what his solution was?

FSMC
Apr 27, 2003
I love to live this lie
I'm unsure on how to implement my save system. The game is a 4X style game, similar to Civ. So I have various units, bases, tech levels, etc I need to save. The code is objective-c++, so it's contains a mixtures of objective-c classes, structures, std::vectors, etc.

Are there any resources on the best way to implement or design a save system? The only way I can think of is to go through all my .h files and see what variables need to be saved, what ones can be calculated, and what ones that aren't needed. Although this method seems like it's just an invitation to bugs. Any major or even some minor changes will need to update the save system as well.

I'm planning on using sql to save the information in a semi-readable/editable format.

I'm also not sure on if I should save everything every turn/or when saved. Or should I have a more continuous update system. For example, add a save/update feature to all functions, so -(void)movePlayer, updates the save files as well.

Calipark
Feb 1, 2008

That's cool.
I know this is a broad and mostly stupid question that gets asked too much, but I'll forge ahead regardless.


For someone with little to no programming experience that wants to get into extensive Game Development, where do you suggest they start? Books, engines, sites, etc.

Bisse
Jun 26, 2005

Coming to you wise guru's with a wee question.

I'm going to start up a project similiar to La Mulana using OpenGL, and was about to go about it with C++. Then I started getting into compiler/header hell with unintelligble bug printouts and remembered how much I abosolutely hate it.

Having recently done a GameBoy emulator (here :) ) using Java I have started liking object oriented languages like it and C# a lot, thanks to their ease of use and how it gives structure to the source code. However for this project I am also looking for a programming language that allows me to distribute it as a single executable file without any additional install requirements. (with Java you'd have to install some Java Runner, same with C# IIRC etc) I also have bad experience with less popular languages thanks to their lack of libraries, meaning I have to code a lot of stuff from scratch myself.

Any recommendations? If C++ wasn't so annoying to work with it would be perfect, and if Java compiled to an independent executable that would be perfect too.

Walked
Apr 14, 2003

Unparagoned posted:

I'm unsure on how to implement my save system. The game is a 4X style game, similar to Civ. So I have various units, bases, tech levels, etc I need to save. The code is objective-c++, so it's contains a mixtures of objective-c classes, structures, std::vectors, etc.

Are there any resources on the best way to implement or design a save system? The only way I can think of is to go through all my .h files and see what variables need to be saved, what ones can be calculated, and what ones that aren't needed. Although this method seems like it's just an invitation to bugs. Any major or even some minor changes will need to update the save system as well.

I'm planning on using sql to save the information in a semi-readable/editable format.

I'm also not sure on if I should save everything every turn/or when saved. Or should I have a more continuous update system. For example, add a save/update feature to all functions, so -(void)movePlayer, updates the save files as well.

Also curious about this. I've been working on an engine that needs to figure this out sometime in the near future. Just curious about a general approach.

Commander Keen
Oct 6, 2003

The doomed voyage of the Obsessivo-Compulsivo will haunt me forever

Walked posted:

Also curious about this. I've been working on an engine that needs to figure this out sometime in the near future. Just curious about a general approach.

Every object / class / etc that you are interesting in saving, should either know how to both read and write its own data, or have save and load functions dedicated to that object. If you try to have a single main function that does all this, you're just asking for trouble.

The main save function, and each object should do something along the following lines: (NB - It's probably a good idea to write everything to a temporary stream of some sort, so that if everything comes crashing down, you're not left with a corrupt save file).

1 - Write version info / any identification data you're interested in.
2 - Write information about the highest level object / objects, which then write themselves and their children out.
3 - Write some sort of closing tag.

When everything is done, write the stream to disk.
To load, read the stream in and recreate your scene based on the data you read in.

This way, if things change, all you need to do is update the save/load functions for the affected objects, and increment the version number for that object. When loading a file older or newer than the current version of the object, you can choose to ignore obsolete or unknown data, or fail / synthesize data when there isn't enough to continue.

SlightlyMadman
Jan 14, 2005

I don't know anything about objective-c, but look up its functions of serialization and reflection. You may be able to natively serialize it and save it to disk (java and python can do this), or you may be able to simply use reflection to iterate it's members and save them in a format of your choice.

Bisse
Jun 26, 2005

Yeah. The simplest way is probably to, in Java for example, have an interface with save and load functions that take some form of input/output-streams as argument. Then you iterate through all objects in the game and let the objects write or read the data from the streams.

more falafel please
Feb 26, 2005

forums poster

Skeletal animation question:

I'm trying to reduce cumulative error from animation compression. Our current animation compression is simple but error-prone: translations/rotations per keyframe per bone are stored in fixed point, so the error propagates down the bone tree.

The way I'm trying to fix this is (at import time) to use the world space position/orientation of each bone atom and recompute the deltas from the parent bone's compressed data.

I don't know anything about animation though, so I'm trying to make sure I understand the problem first. World space is still local to the skeleton, right, since this is all done offline? So wouldn't that make it local space?

Commander Keen
Oct 6, 2003

The doomed voyage of the Obsessivo-Compulsivo will haunt me forever

more falafel please posted:

Skeletal animation question:

I'm trying to reduce cumulative error from animation compression. Our current animation compression is simple but error-prone: translations/rotations per keyframe per bone are stored in fixed point, so the error propagates down the bone tree.

The way I'm trying to fix this is (at import time) to use the world space position/orientation of each bone atom and recompute the deltas from the parent bone's compressed data.

I don't know anything about animation though, so I'm trying to make sure I understand the problem first. World space is still local to the skeleton, right, since this is all done offline? So wouldn't that make it local space?

If the skeleton is the root node, and has no inherent transformation, then yes - the world space transform of each node is local to the skeleton (only the skeleton, not the nodes parent)

Commander Keen fucked around with this message at 21:46 on Jul 15, 2009

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

more falafel please posted:

I don't know anything about animation though, so I'm trying to make sure I understand the problem first. World space is still local to the skeleton, right, since this is all done offline? So wouldn't that make it local space?
"World space" just implies the position/rotation after all transformations are taken into account. If you're treating the model as being at the origin with no rotation, which you'd normally do if processing JUST the model, then local space and world space are the same. If you're doing a more complex scene with multiple animated objects, then world space will be different than model space, but you still would want to follow the same process: Convert EVERYTHING to world space, then compress everything relative to its parent node AFTER factoring compression inaccuracies into the parent node.

It sounds like you've already got the idea down fine, what is it you don't think you understand?

OneEightHundred fucked around with this message at 02:55 on Jul 16, 2009

Ludicrous Gibs!
Jan 21, 2002

I'm not lost, but I don't know where I am.
Ramrod XTreme
Back again with another timing question:

Is it generally better to expect to be able to do x game state updates per second (60 is what I'd like to aim for), or just measure everything in x-per-second and use the delta time each update to determine how much to alter objects' state by? I read a few topics on this on Gamedev.net's forums where the OPs were asking something like this, and there seemed to be a lot of back-and-forth on which one they should use.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Ludicrous Gibs! posted:

Back again with another timing question:

Is it generally better to expect to be able to do x game state updates per second (60 is what I'd like to aim for), or just measure everything in x-per-second and use the delta time each update to determine how much to alter objects' state by? I read a few topics on this on Gamedev.net's forums where the OPs were asking something like this, and there seemed to be a lot of back-and-forth on which one they should use.
Ideally you want to treat everything as x-per-second and allow an adjustable cap on the state update rate. This lets you keep the tickrate adjustable, which has benefits, and lets you keep gameplay running normally even if there's a sudden dive in framerate (i.e. GPU starts to choke or something in the background eats up all of your CPU).

You generally don't want to do state updates every frame because they're much more costly than interpolating between state updates.

One important case where you WOULD want to use a fixed tickrate though is if you're using a timestep-sensitive physics system like ODE which really doesn't like variable timesteps.

OneEightHundred fucked around with this message at 03:54 on Jul 18, 2009

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

OneEightHundred posted:

You generally don't want to do state updates every frame because they're much more costly than interpolating between state updates.

Let's be honest though. Probably 1% of the people in this thread are ones who will be bumping up against performance limits on any reasonable machine these days.

ZorbaTHut
May 5, 2005

wake me when the world is saved

Ludicrous Gibs! posted:

Back again with another timing question:

Is it generally better to expect to be able to do x game state updates per second (60 is what I'd like to aim for), or just measure everything in x-per-second and use the delta time each update to determine how much to alter objects' state by? I read a few topics on this on Gamedev.net's forums where the OPs were asking something like this, and there seemed to be a lot of back-and-forth on which one they should use.

It is technically preferable to do x-per-second.

It's also more complicated and errorprone.

In reality, it's almost certainly better to just fix your internal FPS to a specific number. If that internal FPS is low, you'll have to interpolate, which is complicated. Personally I just always lock to 60 fps.

This is really one of those questions where the answer is "if you have to ask, just lock to 60fps. If that wasn't the best decision, you'd already know it."

(obviously this doesn't apply to non-realtime games)

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Avenging Dentist posted:

Let's be honest though. Probably 1% of the people in this thread are ones who will be bumping up against performance limits on any reasonable machine these days.
Depends on the game I suppose.

The two biggest factors are definitely:
- Is it a single or multiplayer game? Networking generally gets much easier if you have some strategy to keep the number of state updates down.

- Are you dealing with some physics engine that hates variable timesteps (i.e. ODE)?

quote:

If that internal FPS is low, you'll have to interpolate, which is complicated.
How's interpolation complicated?

OneEightHundred fucked around with this message at 10:39 on Jul 18, 2009

Ludicrous Gibs!
Jan 21, 2002

I'm not lost, but I don't know where I am.
Ramrod XTreme
Well, since my game is going to be a basic 2D sprite-based shooter, whose most demanding aspects are that it might need to support multi-layered backgrounds and Geometry Wars-level enemy density, it sounds like a fixed framerate is probably the best solution. Thanks for the responses.

Adbot
ADBOT LOVES YOU

ZorbaTHut
May 5, 2005

wake me when the world is saved

OneEightHundred posted:

How's interpolation complicated?

It's certainly more complicated than not doing it.

Without interpolation, you have a bunch of things that exist, and their positions. Bam, done, render that poo poo.

With interpolation, you have a bunch of things that may or may not exist - they may stop existing in the current frame, but still exist in the previous frame, but they still have to finish their fadeout or their death animation. You have their previous location and their current location - the easiest way is probably to iterate through all objects and store the old location at the beginning of each tick, but that requires that you actually be able to do so, and I've had game designs where I was not, in fact, able to do so easily.

It's not hugely hard, but it's anywhere from an hour to a few days of work, with associated bugs, that you can trivially skip by not doing it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply