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
Scaevolus
Apr 16, 2007

You guys might be interested to learn that Havok is releasing their Physics and Animation libraries as free for non-commercial use.

The full press release is here.

Adbot
ADBOT LOVES YOU

Scaevolus
Apr 16, 2007

Lank posted:

I think that will work well enough to make the game not come to a halt but if characters bunch up for any reason, I'm back at square one with n^2 distance checks per frame where n is the number of players and objects.
It's not the best article, but you're describing Nearest neighbor search.

The better algorithms can reduce the complexity of what you're doing from O(n2) to O(n log n).

Scaevolus
Apr 16, 2007

Stramit posted:

It's cool that you are using pygame, but I just wanted to clear something up. For pretty much any game you are going to be working on by yourself or in a small group that is not AAA Java is fine. Performance wise it is slower then C++, but given the scope of the game you are making this will not be a problem.
This is true. Also, Python is slower than both Java and C++. PyGame works because the performance critical bits (drawing sprites...) are written in C, while the game logic is written in Python.

Scaevolus
Apr 16, 2007

krysmopompas posted:

The needs of Epic in Gears are vastly different from the needs of the general industry. Go ask someone from Midway about native vs. unrealscript performance.
more falafel please works at Midway Chicago.

edit: :downs:

Scaevolus fucked around with this message at 02:58 on Jul 22, 2008

Scaevolus
Apr 16, 2007

Kimani posted:

That's right, if you run this game and have Task Manager next to it, you'll see the amount of threads go up to potentially over 200 at times. Every entity in the game runs on it's own thread - every character, every bullet. It made for an interesting game programming exercise, writing it using message passing and being event-driven, but yeah. Massively parallel.
hahahahahaha

What would be better is having as many threads as processors, and then parceling out tasks to each worker thread. The Source engine does something like this.

If you're going to have more than a dozen threads, using OS threads is a really, really stupid idea.

Scaevolus
Apr 16, 2007

Kimani posted:

Now before I go too far, while I do intend to use this game environment for future projects ( wouldn't want to waste the effort... ) for this program I sort of fudged the collision detection because it needed more work and it was fudgable - and I wanted to finish the drat thing.

The simplest way to do it is just lock the whole scene graph, do your collision test, and get out. But there's multiple things wrong with that. If all you're doing is testing, and not moving things around within the scene graph, then you don't need to impede other threads from doing testing at the same time. So you don't need to lock. But if you are moving things around in the scene graph, you do need to lock so that you don't get 'bad things'.

However, if you're moving things around in area A, there's no reason to deny another thread to do testing in area B. So rather than lock the whole scene graph, you only lock a portion.
What you're describing is a classical problem in concurrent programming, called "readers-writers". You should read The Little Book of Semaphores. It's on page 71.

Scaevolus fucked around with this message at 01:09 on Sep 16, 2008

Scaevolus
Apr 16, 2007

not a dinosaur posted:

The rightmost pixels on the character's head are malformed- they are not square anymore. The "l" above his head is sometimes straight, and sometimes crooked like in this picture.
It's easiest to just write your own scaling routine if you want true squares. Usually built-in scaling uses floating point, which can cause those sorts of artifacts.

Scaevolus fucked around with this message at 22:18 on Nov 1, 2008

Scaevolus
Apr 16, 2007

Mithaldu posted:

Sure there are. :)
That's a coincidence of how realloc() works with very small chunks.

He should have stated it more clearly-- you can't guarantee that a pointer to an element in a resizable array will always be valid (barring obscure data structure).

Scaevolus
Apr 16, 2007

ultra-inquisitor posted:

Have you seen DungeonMaker? It's by far the best generator I've come across.
This is really more of a maze generator than something that generates rooms joined by passages. You need to specify a lot of it yourself if you don't want a ton of dead ends.

Scaevolus
Apr 16, 2007

Morpheus posted:

Me, I'm doing a more open roguelike, and I've got to figure out random city generation algorithms on the small scale. Being able to, say, make a suburban area where suburbia has an x to y amount of houses, z% chance of a police department, and stuff like that while still making the place look 'normal' (houses in front of streets that go somewhere), that's something I'm working towards.

Have you seen Subversion's city generation process?

Scaevolus
Apr 16, 2007

SlightlyMadman posted:


I'm pretty sure pygame uses (embarassingly slow) software blitting-- did you try this in pyglet + rabbyt? They have demos with hundreds of moving sprites and good performance.

Scaevolus fucked around with this message at 02:15 on Jan 5, 2010

Scaevolus
Apr 16, 2007

Hanpan posted:

After that, I tried out pygame and some of the libraries associated with 2d gaming. It's nice but I ran into the same performance problems I encountered with Flash.

It seems to me the only real way to get the performance I want is to either build something for scratch. Does anyone know of any other engines out there I could try?

Have a look at Pyglet & Rabbyt.

Scaevolus
Apr 16, 2007

Hanpan posted:

Isn't Python similar to Flash in regards to performance? I'd really like get some parallax scrolling on the go and all sorts.

Pyglet uses OpenGL, so it should have better performance than Flash or Pygame's software rendering.

Scaevolus
Apr 16, 2007

FateFree posted:

I'm looking for advice on a good beginner book for game developing, what language or platform to consider for a long term 2D project (while I love Java, I want to work on a language more geared towards professional gaming), and any other starting advice.

I don't think it really matters at the beginning. Your first few engines are going to be terrible while you learn how to structure things no matter which language you choose.

Scaevolus
Apr 16, 2007

Hanpan posted:

Does anyone have any recommendations for 2d physics with XNA? I think someone here recommended Farseer, but it doesn't seem to get updated very often. It's a shame that there is no direct implementation of Box2D :smith:

http://code.google.com/p/box2dx/ ?

Scaevolus
Apr 16, 2007

HappyHippo posted:

Is it just me, or is Blender's interface really annoying? It took me forever to texture a simple cube. All the tutorials I've found online seem to be out of date, and Blender likes to change things somewhat radically between releases it seems. Anyone know of any up-to-date tutorials for version 2.49?

It's not just you. Blender is infamous for its terrible interface, despite what rabid open-source apologetics say.

It's a shame Autodesk canceled Maya Personal Learning Edition. :smith:

Scaevolus
Apr 16, 2007

Don't use GL_QUADS, it doesn't work on some hardware. Use GL_TRIANGLE_STRIP with degenerate triangles if you want to do more than one quad per glBegin/glEnd pair.

Scaevolus
Apr 16, 2007

monsterland posted:

The rest was fairly obvious. Though OpenGL's scaling flags suck donkey cock, so I had to make the bitmaps 64x64 (and maybe that's not even large enough for uber-displays), so that the scaling method used is very basic, and yet due to being DOWNscaled it doesn't look ugly.
You might find this interesting: http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf

Scaevolus
Apr 16, 2007

FreeType is somewhat heavyweight.

Sean Barret has a public domain 1800 line TrueType font rasterizer that will probably do everything you need.

Scaevolus
Apr 16, 2007

ATI really doesn't like OpenGL for some reason.

Scaevolus
Apr 16, 2007

I like the optimization notes for KNES:

quote:

Compile with the “-Cl” switch, this makes local parameters static. Otherwise they’re allocated from the CC65 software emulated stack, which is understandably very slow. One drawback to this is that every single temporary variable will now take a byte in RAM, even if it’s used very rarely. It might be a good idea to have some generic temporary global variables for that purpose instead.
Use #pragma bss-name and/or data-name to place variables on the zero page.
Avoid passing parameters to functions — use global variables. If you need parameters, use the __fastcall__ calling convention, which can pass two byte variables in the A and X registers.
Use the optimizer (“-Oirs” switch) BUT be aware that it might in some cases produce broken code. One such case is when you read the controllers by strobing $4016, then reading it eight times. The first read is optimized away. Of course when you’re using this library you can simply use read_joy().
Don’t use structs or at least be very careful with them! Instead of stuff like struct Foo { int a; char b; }; struct Foo foos[NUM_FOOS]; try using struct Foo { int a[NUM_FOOS]; char b[NUM_FOOS]; }; struct Foo foos; for performance.
I never considered how annoying it is to compile C to 6502 code.

roomforthetuna posted:

Have you considered homebrew DS? There's probably more people who'll play a DS game if you make a decent one, and there's a reasonably functional C library and documentation for it, and even an emulator with debugger (no$gba is the emulator, I think the version with the debugger costs a few bucks).

no$gba is dead, and there's no way to get the debugger version anymore.

DeSmuME is still quite active, and that's what a lot of DS homebrew devs use.

Scaevolus fucked around with this message at 21:32 on Feb 26, 2011

Scaevolus
Apr 16, 2007

Tw1tchy posted:

Anyone have some good examples/tutorials/libraries to use for netcode in gaming? I tried winsock but holy poo poo there's like 3 tutorials for it in total that aren't just codedumps and they don't explain half the stuff, and winsock seems really old anyway. Anything for c++ for use with SDL/openGL.
As OneEightHundred said, Quake 3 is a decent place to start. This has a good writeup on how it works.

Scaevolus
Apr 16, 2007

Tw1tchy posted:

Thanks for the help. I'll read through all that soon when I get the time. Also what I'd be using it for would be a tile-based game, so would all the stuff in it still be completely fine for what I need to do? And does it mention what libraries to use for netcode; because that's still a big problem of mine.
What exactly does tile-based mean? Is your game real-time, or can your players stand occasional latency spikes? If latency and throughput aren't important, a simple line-based text protocol would probably work fine.

For libraries, you could use something like Boost.Asio to wrap the platform-specific details.

Scaevolus
Apr 16, 2007

dangerz posted:

The cube dictionary is already local to each chunk.

Is there any reason why you're using a dictionary rather than an array?

Scaevolus
Apr 16, 2007

dangerz posted:

Dictionary let's me do a fast key lookup (o(1)) and iteration through the whole thing.

Array has a fast iteration but not a fast lookup. I'm def open to suggestions if you have a better idea.
How many entries are in the dictionaries? Is it not 16 * 16 * 128?

Scaevolus
Apr 16, 2007

Jonathan Blow (the creator of Braid) gave a talk at UC Berkeley titled "Programming Aesthetics learned from making independent games" with a lot of good advice.

Scaevolus
Apr 16, 2007

Logarithmic depth buffers are a good solution for rendering things at extreme scales. His example with a 24-bit Z-buffer has a resolution of 2 micrometers at 1 meter, and a resolution of 10 meters at 10,000 km.

Also, Infinity is an indie space MMO that seems to be aiming at accomplishing a lot of the same things...

Scaevolus
Apr 16, 2007

Have an option in your settings screen: "Text speed: [Instant] Fast Normal Slow".

Scaevolus
Apr 16, 2007

Winkle-Daddy posted:

As someone who did tech support for Adobe, I can tell you postscript is not dead. In fact, PDF files are created by taking a postscript file and running it through the Adobe Distiller to convert those postscript instructions into a .pdf/.ai document (really they're the same thing with a different extension. If you have illustrator, rename a downloaded PDF to whatever.ai and open it!)

Learning to read postscript sucked, and I don't remember any of it.
Postscript is also a useful attack vector for exploiting printers!

https://www.youtube.com/watch?v=PqL5P46m_zQ

Scaevolus fucked around with this message at 06:09 on Jan 14, 2012

Scaevolus
Apr 16, 2007

My Rhythmic Crotch posted:

Just curious if anyone has seen a complete tileset suitable for 2D RTS use? I know most everything is done in 3D these days so... I probably won't have any luck, but I thought I would ask.
This guy has some good free tilesets.

http://lunar.lostgarden.com/game_HardVacuum.htm

Scaevolus
Apr 16, 2007

It's a 32 bit machine. https://github.com/JohnEarnest/Mako/blob/master/src/MakoVM.java#L43

Scaevolus
Apr 16, 2007

Shalinor posted:

As I am about to dive in head-first, does anyone happen to know of a Hello World-esque walkthrough of all of the back-end PHP et al that typically drives a web/Facebook game?
I strongly recommend using Python instead of PHP if at all possible.

Scaevolus
Apr 16, 2007

HaB posted:

So...does anyone know what method it's using to choose? Thanks in advance.
It generates random points near the origin until it finds one that's sand on top.

Scaevolus
Apr 16, 2007

Internet Janitor posted:

Thanks, guys! If you have any thoughts about the gameplay I might still do some tweaking. I feel like it's a little threadbare.

the only winning move is not to play (you should get fired and lose the game if you miss two days of work in a row)

The clock should be advanced before telling the player he is running late.

Making the title image -> optimal tile grid calculation into a compile-time directive (:image-compress title-tiles title-grid "title.png" 8 8 ?) might be a good idea.

:enum bed alarm-clock ... could replace :const bed 0 :const alarm-clock 1 ...

Scaevolus
Apr 16, 2007

Lua evolved as an embedded language, and it shows in the design. One of its 8 types, "userdata", is specifically dedicated to interoperating with C.

Python evolved as a general purpose language, and embedding it was obviously never a primary objective.

Scaevolus
Apr 16, 2007

Kaf posted:

Can anyone recommend any books on designing/implementing match-making services? Getting into this soon at work and it's a whole new field for me.

Microsoft's published information on their Trueskill ranking system should be quite useful, and includes formulas for calculating skill and performing matchmaking.

Scaevolus
Apr 16, 2007

HappyHippo posted:

Anyway I just thought I'd share in case anyone else was having similar issues. Does anyone have any other suggestions/good reading material on this? Most of what I found on google was similar to my first two implementations.

Left 4 Dead uses something called "Reactive Path Following" -- http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf pg 14

Modifying the navigation mesh to avoid collisions seems harder than just doing collision tests directly.

Scaevolus
Apr 16, 2007

Are there any benefits of FRP in comparison to a normal non-pure language's mutable objects?

It seems like it requires an elaborate arrangement of events and state transitions to support basic updates.

Scaevolus
Apr 16, 2007

Surprise T Rex posted:

Are there going to be any negative effects from coding a game in an interpreted language like Python? It's what I'm learning at University at the moment and I figure that I might try to knock out a really simple game in my spare time.
Python is generally faster to write, but executes slower.

For simple games, you should be fine.

Most 2D games could be written in Python, but 3D usually requires better performance.

Adbot
ADBOT LOVES YOU

Scaevolus
Apr 16, 2007

I've been experimenting with PuzzleScript (site is currently down), a tiny language for making grid-based puzzle games.

I did a "demake" of the LD28 game PUSH.

Play it here.




PuzzleScript can be surprisingly concise. The core behavior only takes up 40 lines of code.
source code | editor link

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