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
ninjeff
Jan 19, 2004

quote:

saving angles
This might be a bit out there, but how about saving angle in radians/pi as a ratio (ordered pair of integers)?

Adbot
ADBOT LOVES YOU

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!

ninjeff posted:

This might be a bit out there, but how about saving angle in radians/pi as a ratio (ordered pair of integers)?
That's pretty clever, but I think I want these files to be human-readable for the time being and that's a little weird to look at. If I understand it correctly, it would then be a number from 0 to 2, with the common angles being "0.25", "0.5", etc?

ninjeff
Jan 19, 2004

Orzo posted:

That's pretty clever, but I think I want these files to be human-readable for the time being and that's a little weird to look at. If I understand it correctly, it would then be a number from 0 to 2, with the common angles being "0.25", "0.5", etc?

I was thinking "1/4" and "1/2", but that works too. Decimals are probably better than fractions for the general case.

Also, how about appending "pi" or "*pi" for human readability? The parser can ignore it.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
You could get some simple compression for an ASCII format if you scale the rotation into a fixed number of decimal digits. Map your 0->360 degree range onto an arbitrary 000->999* scale and you'd be storing the rotation to within less than half a degree with three human-readable characters. It shouldn't be too hard to recognize 'special' values like 500, 250, 750, etc.


*really 0->1000, but wrapped around with 0=1000

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Thanks for the advice. I'm still leaning towards just storing them as degrees since the implementation is simple and is very human-readable (arguably more readable than plain radians) but I'll take all of the approaches into consideration.

ninjeff
Jan 19, 2004

Orzo posted:

Thanks for the advice. I'm still leaning towards just storing them as degrees since the implementation is simple and is very human-readable (arguably more readable than plain radians) but I'll take all of the approaches into consideration.

Degrees are probably the best option, all things considered. I should have listened to my instincts about saving radians being "out there"! Interesting to think about, anyway.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!
If you need a little more precision than integer degrees, I'd suggest still going with integers and just making it measure in tenths-of-degrees or hundredths-of-degrees - it remains nearly as human-readable as straight degrees, and saves on the wasted space and text-to-float parsing of a decimal point.

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through

Orzo posted:

And yes, it's because floats are too bulky.

Aren't floats and ints the same size?

Vino
Aug 11, 2010
Only if they're both 32 bits, which happens sometimes but not always.

But I think when he said bulky he meant digits wise, integers never having any after the decimal place.

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
In memory maybe, serialized to a file definitely not.

seiken
Feb 7, 2005

hah ha ha
There's no difference in this sense between memory and a file, what you mean is the distinction between human-readable representation or not... you can absolutely store the string (decimal ascii) representation in memory or the binary representation in a file if you want to

seiken fucked around with this message at 17:35 on Nov 24, 2011

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Yes, sorry, that's what I meant--a human readable file, not a binary file.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!
Just in case the misunderstanding is something different, "serialized" does not mean "stored in ascii format". You could serialize floating point angles into a file by scaling them into an integer between 0 and 65535 and writing them out as two binary bytes, if you wanted. So the point is more that floats are much bigger than integers when written out in ascii format (unless you truncate them to a sensible number of significant digits in which case they're only slightly bigger).

Edit: vvvv Yeah. The second one wasn't there when I wrote it, and the first one didn't clarify that the word "serialized" would still apply to a binary data format, which is what I was getting at in case someone had some terminology confused. The last post above made it clear that that wasn't the case, but too late!

roomforthetuna fucked around with this message at 18:11 on Nov 24, 2011

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Yes, that's basically what the two posts previous to yours were saying, right?

TJChap2840
Sep 24, 2009
Can anybody point me to some references that they have used for Perlin and/or Simplex Noise with respect to 2D map generation? I've been browsing around, but most of the things I have seen are terrible or overly complex.

Vino
Aug 11, 2010
I can't vouch for it not being terrible and/or overly complex, but fractal simplex noise generation is exactly how i generated the terrain for Digitanks, and you'll find all of that code available on Github

https://github.com/BSVino/Digitanks

Here's the specific files:

https://github.com/BSVino/Digitanks/blob/master/common/math/simplex.h
https://github.com/BSVino/Digitanks/blob/master/digitanks/src/digitanks/terrain.cpp

You'll find the meat of it in CTerrain::GenerateTerrain()

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

TJChap2840 posted:

Can anybody point me to some references that they have used for Perlin and/or Simplex Noise with respect to 2D map generation? I've been browsing around, but most of the things I have seen are terrible or overly complex.

Can you be more specific? Like how one would use perlin noise? Or how one generates it?

TJChap2840
Sep 24, 2009

Pfhreak posted:

Can you be more specific? Like how one would use perlin noise? Or how one generates it?

Implementations with regards to using Noise to create a pseudo-random game map and how/when to apply textures/tiles.

AuMaestro
May 27, 2007

I would like to make this sort of thing:


Those circles would be simple sprites representing spaceships, and the basic game concept is that they would fly around between colonies in realtime, trading with each other, and the player would have a management role. So, it's basically Transcendence or a 2D Elite, but as a strategy game rather than controlling one ship.

That's obviously not very high tech, and there are a lot of ways I could go about it, but since I've been sick a long time I don't know anymore what would be current and appropriate technologies. WinForms seems really old. WPF, which I used for this mockup, seems really difficult to use for me for anything non-trivial. Maybe there's some kind of 3rd party GUI that would be better (like Crazy Eddie's), or maybe I should just get over it.

The graphical side obviously doesn't need to be very sophisticated, but I do need something for it, and I simply don't know how to make the decision between something low-level like DirectX, XNA (for which Microsoft seems to be walking away from PC games), or using an engine that someone else has made - perhaps even misusing a 3D engine like OGRE, if its ease-of-use turns out to make it a more appropriate option than something else. I would like to stick with languages I already know - C++ and C# - but I would also like to learn how to use tools and libraries better. Any ideas?

DrMelon
Oct 9, 2010

You can find me in the produce aisle of the hospital.
libSDL, perhaps?
It focuses on 2D development, pretty easy to set up and use.
I'm pretty sure there are GUI libraries/modules for it too.
C++ is its primary development platform, but there's wrappers and ports to most languages.

DrMelon fucked around with this message at 00:18 on Nov 27, 2011

DancingMachine
Aug 12, 2004

He's a dancing machine!
Flash or Silverlight (also dying on the PC) would be good choices for that. XNA will work but it doesn't have good UI support built in. Not sure how hard it is to integrate XNA and WPF in the same app. Seems like it should be possible but I've never tried. If it works that would be a great choice.

Vivian Darkbloom
Jul 14, 2004


Sooo, I'd really like to make a Paradox-style game, only turn based and with all my own mechanics. Paradox games are strategy games with maps like this, where you control a country in a historical setting:



Is there a practical (and inexpensive) platform I could use to get started with a project like this? Would PyGame be suitable at all? I guess at the very least, I need a way to make a scrolling map, screens with lots of options (as in the Civ series), pop-ups, AI (both strategic and pathfinding), a backend capable of implementing lots of complex rules...

Deki
May 12, 2008

It's Hammer Time!
Have any of the goon devs tried using Kickstarter to fund a game project? I'm trying it now to fund the RPG I'm working on, and the site is doing a lovely job giving me a clear picture of the fail/success ratio.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Vivian Darkbloom posted:

Sooo, I'd really like to make a Paradox-style game, only turn based and with all my own mechanics. Paradox games are strategy games with maps like this, where you control a country in a historical setting:



Is there a practical (and inexpensive) platform I could use to get started with a project like this? Would PyGame be suitable at all? I guess at the very least, I need a way to make a scrolling map, screens with lots of options (as in the Civ series), pop-ups, AI (both strategic and pathfinding), a backend capable of implementing lots of complex rules...

Pygame would probably work fine. So would XNA (C#) or Actionscript 3 (Flash). Or SFML (C++). Really, any language choice should be able to handle this...

You'd be surprised the amount of work needed to even produce a map that looks like that though, so I'd tackle it one small piece at a time.

GROVER CURES HOUSE
Aug 26, 2007

Go on...

Pfhreak posted:

You'd be surprised the amount of work needed to even produce a map that looks like that though, so I'd tackle it one small piece at a time.

Hey man, have some of this poo poo :2bong:

Exioce
Sep 7, 2003

by VideoGames
Please don't laugh at me but I have no programming experience whatsoever (apart from a short Pascal module around a decade ago) and I want to start down the no doubt long road that will be required to make browser based multiplayer games - perhaps something like Pardus in a few years. Where should I start? Which language will serve me best, and is there a comprehensive online tutorial that will take me where I want to go in time, if I put in the hours?

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Deki posted:

Have any of the goon devs tried using Kickstarter to fund a game project? I'm trying it now to fund the RPG I'm working on, and the site is doing a lovely job giving me a clear picture of the fail/success ratio.
I have not, but I have done quite a bit of preparatory research into it (we'll be throwing one up early next year). The success/failure ratio is grim, and your page is not one of the good ones.

1.) You really need gameplay footage (really, really)

2.) You really need more art / screenshots

3.) In general, your description is weak. It reads like "a bunch of random dudes who played SNES/NES games like Dragon Quest 3 want to make a game like that!" - which doesn't inspire confidence. Why should anyone believe you'll finish what you start, if the best you've done thus far is a bland "castle picture"?

4.) How are you going to distinguish yourself from NEStalgia, which looks... uh, like what you're doing, only, well, a bit better.

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


Kickstarter is typically poor for funding a project that is just starting, however odd that might seem. To attract interest, you generally need a project that's far enough along to show well.

EDIT: To more specifically answer your question, the above list (video!!, screenshots, solid description) are what marks out the Kickstarter successes from the failures. They're brought up in every post-mortem I've ever read - with a lack of compelling gameplay video typically being the #1 listed regret. Less than compelling prizes are also mentioned occasionally, but aren't the barrier you might expect, so long as you offer really high-end prizes (no matter how silly it may seem, never eliminate the chance of a well-meaning super fan giving you a lot of money).

Shalinor fucked around with this message at 22:00 on Nov 27, 2011

Deki
May 12, 2008

It's Hammer Time!

Shalinor posted:

I have not, but I have done quite a bit of preparatory research into it (we'll be throwing one up early next year). The success/failure ratio is grim, and your page is not one of the good ones.

1.) You really need gameplay footage (really, really)

2.) You really need more art / screenshots

3.) In general, your description is weak. It reads like "a bunch of random dudes who played SNES/NES games like Dragon Quest 3 want to make a game like that!" - which doesn't inspire confidence. Why should anyone believe you'll finish what you start, if the best you've done thus far is a bland "castle picture"?

4.) How are you going to distinguish yourself from NEStalgia, which looks... uh, like what you're doing, only, well, a bit better.

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


Kickstarter is typically poor for funding a project that is just starting, however odd that might seem. To attract interest, you generally need a project that's far enough along to show well.

EDIT: To more specifically answer your question, the above list (video!!, screenshots, solid description) are what marks out the Kickstarter successes from the failures. They're brought up in every post-mortem I've ever read - with a lack of compelling gameplay video typically being the #1 listed regret. Less than compelling prizes are also mentioned occasionally, but aren't the barrier you might expect, so long as you offer really high-end prizes (no matter how silly it may seem, never eliminate the chance of a well-meaning super fan giving you a lot of money).

Yeah, our team was initially planning to scrape some money together to hire an artists so that our game would look more attractive on Kickstarter, but two of us losing our jobs kind of killed that idea, and was the catalyst for trying to kickstart it now rather than when we have the game nearly complete. We are working on a gameplay video, but our biggest issue is that while we could show off an impressive amount of gameplay, our art is really loving lovely in most places, and is a placeholder for when we can actually hire out an artist we know to finish up.

As for the NEStalgia comparison, perhaps I need to do a better job explaining what we're doing, but what we're working on isn't that similar with the exception that it's a turn-based RPG on the Byond engine.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!
I would add also that many of the kickstarter successes are starting from a position of already having some amount of a fanbase (even if for a different project). Which is to say, a person with a successful webcomic, blog, online game, etc. is going to have a hell of a lot of an easier time getting people to donate, because they'll get a fraction of their existing fans to actually consider it. (And those people will have more trust in you than people looking at you as a complete stranger.)

To put it another way, it doesn't matter how good your kickstarter page content is if only 20 people ever look at it.

roomforthetuna fucked around with this message at 22:41 on Nov 27, 2011

Nalin
Sep 29, 2007

Hair Elf

Deki posted:

Have any of the goon devs tried using Kickstarter to fund a game project? I'm trying it now to fund the RPG I'm working on, and the site is doing a lovely job giving me a clear picture of the fail/success ratio.
We managed successfully:
http://www.kickstarter.com/projects/suckerfreegames/dungeons-the-eye-of-draconus

I would think the biggest chance of success is having a great trailer. Show gameplay and prove that you are competent enough to get the project done. If you come across as professional, that will give people the confidence to invest in you. It helps to give people a wide variety of pledge options, too. If you can give some sort of physical token for the pledge, it really helps. Just keep in mind things like production/shipping costs if you do decide to have a physical pledge.

Vivian Darkbloom
Jul 14, 2004


Pfhreak posted:

Pygame would probably work fine. So would XNA (C#) or Actionscript 3 (Flash). Or SFML (C++). Really, any language choice should be able to handle this...

You'd be surprised the amount of work needed to even produce a map that looks like that though, so I'd tackle it one small piece at a time.

Yeah, the more I think about all the stuff that's required, the more it seems like kind of a nightmare. Maybe I'll start with a toy project where the map doesn't scroll around at all; PyGame seems to have plenty of examples.

dangerz
Jan 12, 2005

when i move you move, just like that
Would anyone be interested in trying my game out? I'm not sure what the official protocol here, but you can get the download link and more details here: http://forums.tigsource.com/index.php?topic=22847.0

The game is written in C#/XNA and I only have a Windows build currently. I did toy with switching to MonoGame (so I could have other builds), but I need to do some more research there.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!
What's the verdict on web gl? And do people have a preferred framework they like to work with?

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Pfhreak posted:

What's the verdict on web gl? And do people have a preferred framework they like to work with?

WebGL is probably unsecure and not a great idea but it's pretty neat, Three.js is a nice framework with a lot of features and a whole bunch of examples.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

piratepilates posted:

WebGL is probably unsecure and not a great idea but it's pretty neat, Three.js is a nice framework with a lot of features and a whole bunch of examples.

Concise response, good info. Thanks!

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
Possibly a big of a long-shot... any ActionScript / ScaleForm coders in here?

I've got a chat bubble system built in ScaleForm, and it works pretty well. What I'm doing here is trying to adjust the size of the chat bubble to fit its contents, if the specified size was too big:
code:
	if (bubble_txt.dialog.textWidth < (bubble_txt.dialog._width - bubble_text_horiz_buffer))
	{
		// If there's a size difference, calculate the percenate of width actually used...
		width_diff = bubble_txt.dialog.textWidth / (bubble_txt.dialog._width - bubble_text_horiz_buffer);
		height_diff = bubble_txt.dialog.textHeight / (bubble_txt.dialog._height - bubble_text_vert_buffer);
		
		// Adjust the previously-calculated bubble width accordingly...
		bubble._width *= width_diff;
		bubble._height *= height_diff;
		
		bubble_txt.dialog._width *= width_diff;
		bubble_txt.dialog._height *= height_diff;
		
		// And re-position the bubble as though the smaller width were specified
		bubble._x = bubble_x - (bubble_width * width_diff / 2.0);
		bubble._y = bubble_y - (bubble_height * height_diff);
		
		bubble_txt._x = bubble_x - (bubble_width * width_diff / 2.0);
		bubble_txt._y = bubble_y - (bubble_height * height_diff);
	}
... the idea being, we specify a max allowable width and height, and then it auto-downsizes if the contents are less than that. Since the position is offset to be bottom-center, that scale still leaves the bubble centered on the speaker properly, and it all works.


The issue is in those bubble_text_horiz_buffer and bubble_text_vert_buffer terms. Those are there because a text field's _width equalling the textWidth seems to result in the text field then being too small for its contents, thus wrapping the text down to the next line. I thus threw in a buffer to fix whatever mathematical weirdness is happening there...

... "but" - given my implementation, when the font size changes, so does the effective buffer size. A bigger font size, say going from 18 to 30, makes the buffer quite a bit bigger. I think it's because of that term being coupled in with the font size-dependent width, or... something. It's all getting a bit weird.


Ideally, I would remove those buffer terms entirely, since they are relatively silly - it seems like fontWidth and _width should be able to be equal and have the text thus fit perfectly. I would settle for just getting it to be a fixed buffer of X pixels in either direction that is not dependent on font size, though. Any thoughts?

(EDIT: and as far as I can tell, there's a similar issue with _height and textHeight, it's just harder to pin down)

Shalinor fucked around with this message at 01:31 on Nov 29, 2011

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

piratepilates posted:

WebGL is probably unsecure
I think Carmack said it was a bad idea as the driver programming atmosphere was not one of security. I had this one just yesterday:
code:
// ok
_gl->TexParameteri(_target, GL_TEXTURE_MAX_LEVEL, _levels.Count()-1);
<upload mipmap levels>

// crash on Catalyst 11.9
<upload mipmap levels>
_gl->TexParameteri(_target, GL_TEXTURE_MAX_LEVEL, _levels.Count()-1);
... so yeah, I've got kind of low hopes for it unless web browsers are seriously up to the task of scrubbing everything to deal with crap drivers. I think Chrome already recompiles GLSL shaders or something.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Shalinor posted:

(EDIT: and as far as I can tell, there's a similar issue with _height and textHeight, it's just harder to pin down)
Not answering from a position of knowledge of the specific things you're using, but having had similar issues with text handling in other environments - are there some other values you can get out other than textHeight and textWidth? Leading, spacing, margins, padding, kerning are some possible text-associated values that would essentially be a frustrating "margin of error", some of which would change with the font size and some of which would not.

Edit: alternatively, if those values are integers it might just be that you need it to be (A/B)+1 rather than (A/(B-margin))?

roomforthetuna fucked around with this message at 03:23 on Nov 29, 2011

ambushsabre
Sep 1, 2009

It's...it's not shutting down!

OneEightHundred posted:

I think Carmack said it was a bad idea as the driver programming atmosphere was not one of security. I had this one just yesterday:
code:
// ok
_gl->TexParameteri(_target, GL_TEXTURE_MAX_LEVEL, _levels.Count()-1);
<upload mipmap levels>

// crash on Catalyst 11.9
<upload mipmap levels>
_gl->TexParameteri(_target, GL_TEXTURE_MAX_LEVEL, _levels.Count()-1);
... so yeah, I've got kind of low hopes for it unless web browsers are seriously up to the task of scrubbing everything to deal with crap drivers. I think Chrome already recompiles GLSL shaders or something.

Holy poo poo how did you ever manage to debug that? Code order is obviously important, but *that* important?

Adbot
ADBOT LOVES YOU

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

ambushsabre posted:

Holy poo poo how did you ever manage to debug that? Code order is obviously important, but *that* important?
I debugged it by stepping through until it crashed on that line every time.

"Stepping through" being necessary of course because drivers trash the frame pointer so you don't get a valid trace back into your own code. This is kind of mild compared to BSODs I've had previously.

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