123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|714|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Jay needs something tested..

Page : 1 2 Next
Prev
Wed, 22 Aug 2007, 16:24
Jayenkai
You know... Something's been bugging me for ages.

Test Me

Run, then post the contents of JNKTest_Output.txt



-=-=-
''Load, Next List!''
Wed, 22 Aug 2007, 16:29
steve_ancell
I just ran it, and it comes up with...



Wed, 22 Aug 2007, 16:35
Erebel55
Here ya go Jay.



-=-=-
Lava Monkey
https://play.google.com/store/apps/details?id=com.lvm.lavamonkey
Wed, 22 Aug 2007, 16:45
Jayenkai
Chomage

You'll also find that the blitz 'random number' generation is not consistant over all processors.


I was told this years ago, and so have avoided using seeded Rand to build levels and such.

About 30 minutes ago, I reran Light and Dark which uses seeded random levels to work. The levels were exactly as I remembered them.

I found this puzzling, since I've ran it on about 3 other systems since originally coding it.

I just thought I'd get a small test going, to finally see if it's true or not.

|edit| Waits for Shroom's results! |edit|

-=-=-
''Load, Next List!''
Wed, 22 Aug 2007, 17:03
Afr0
I don't mean to troll, but this is what one gets when relying on writing one's programs in such a high-level, 'third party' language.

That said, the obvious solution to this problem (if it even is a problem) is to roll your own implementation in whatever version of Blitz you are using, and not relying on the built in Rand command.
Also, I'd like to add that I think Blitz is a mighty fine language for newbies to programming (especially games, I guess) and indies, but it has to be said that weird things like these makes me realize why people on other boards around the net are sometimes warning people against building too complex programs/games in these kind of languages, especially if they are expecting to get the same amount of control over their programs/games with a comparably small number of lines of code.

Edit: I see that the example output posted seems to be pretty much equal in all cases, but then again I guess people on BB.com wouldn't warn about this if it wasn't an issue. Some people might argue that to get full, complete control over the behaviour of such things as random number generators on different processors, one would/should need to switch to ASM. My response to this is that people should at least start using BlitzMax now then, since it allows for inlining Assembly, and seeing as Blitz3D isn't being updated anymore, it seems like a reasonable thing to do either way.

Edit2: Another reason why these boards need an ASM section, Jay!

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Wed, 22 Aug 2007, 17:08
Jayenkai
Calm down, it wasn't that important..
Wed, 22 Aug 2007, 17:31
mike_g
I reckon high level languages are good. With Blitz you got a stable framework to produce games fast. If you are going to code a large project in ASM, youre going to end up with a whole lot more bugs plus it takes longer.
Wed, 22 Aug 2007, 18:09
Nolan
An entire game in ASM would be foolish and pointless.

-=-=-
nolandc.com
Wed, 22 Aug 2007, 18:13
Jayenkai
... Has anyone had a different result yet?
Wed, 22 Aug 2007, 18:17
mike_g
Dunno. Heres what I got:

|edit| Looks more or less the same to me |edit|
Wed, 22 Aug 2007, 19:05
JL235
Roller Coaster Tycoon was almost entirely written in assembly.

But I find far more strange things in Blitz then other higher languages. Like how 'not', 'and' and 'or' don't have the same presidence as in other languages.

Java ensures that all calculations will be the same on all architectures. So I'd expect it's Random class will give the exact same results on all platforms. That also gives the impression that different architectures can give different results. But it might be more connected to how well the architecture works. Some years ago there was a bug on one of the Pentium architectures which meant it would give incorrect results.
Wed, 22 Aug 2007, 19:44
mike_g
Roller Coaster Tycoon was almost entirely written in assembly.

dosent mean its not pontless

Sure ASM has its purposes: for drivers, certain os tasks, tiny demos, and optimization for some sections of intensively used code. But other than that its not really worth worrying about. Unless perhaps someones was going to come up with an ASM coded MMORPG. Now that would really impress me!
Thu, 23 Aug 2007, 00:37
Afr0
An entire game in ASM would be foolish and pointless.


Yeah, yeah, I realize that (though that doesn't mean it wouldn't be possible). What I was trying to get at was that at least in BlitzMax one can switch to ASM when neccessary to gain a finer degree of control over certain parts of one's program, such as when rolling random numbers.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Thu, 23 Aug 2007, 00:51
shroom_monk

I got the same as everyone else! For a change.

Anyway, whenever I use random numbers in Blitz, I seed it with millisecs(), thereby getting a different seed each time.

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Thu, 23 Aug 2007, 01:35
JL235
Jays point is that he wants it to always give the same result. For example he may want to randomly generate some levels (cos he's lazy) and so he'd want to ensure level 1 is always the same on every pc, every time you played it.

Also I agree, it's better to make games in a higher level language rather then assembly. But it's still been done.
Thu, 23 Aug 2007, 03:42
Jayenkai
OK, Shroom, here's a good reason for using static random numbers..

Imagine you take your orbital physics engine, and turn it into some kind of Gravitational Wargame, with enemies firing shots across space at each other's ships.
Kinda like "Worms in Space!"

Your levels can be entirely random. But if you know the same seed will give the same result, it means you can add a text based seed into the level generator, so that the same level can be randomly generated each and every time.

And if the same seed always gives the same result, you could make the game online-multiplayer, and have everyone's game start with the same level, just by sending the seed to each player.

-=-=-
''Load, Next List!''
Thu, 23 Aug 2007, 04:49
ingenium1
Lol... Jay... my result is different xD



-=-=-
Roger Federer is go(o)d.
But he is not alone.

Just relax... sometimes there's no need to argue.
Thu, 23 Aug 2007, 04:51
shroom_monk
Aah! I get it now. Thanks Jay + DD.
Thu, 23 Aug 2007, 04:53
Phoenix
My result is the same as everyone else's. Even though it works on our computers, it doesn't mean that the bug is gone. But it could.

I think we all know that making a game in ASM is quite pointless, on the other hand it would probably be good learning experience.
Thu, 23 Aug 2007, 05:06
Jayenkai
So, Ingenium, what processor do you have, and why exactly are you getting different results?

-=-=-
''Load, Next List!''
Thu, 23 Aug 2007, 05:15
JL235
To me it looks exactly the same only with the end is missing. I'll write a quick Ruby program to compare, should be done in 5 minutes.
Thu, 23 Aug 2007, 05:20
ingenium1
ingenium
NYEK YCJJBGRMWRBUTNVVZJTNXRBP DIQ
U
FSGNYVX YSRKUOOGBAWEKMWHGBOTG K XMPZTYYNQYCXNVTHWQ A
JUVUP COGUWRVKW OKQ
QHMKNJIIMYL ZSP
JCBFSS
XHYBJDKB
Y
TJJ
SRKKFMN IXR SUIGBQ S


Jayenai
FSGNYVX YSRKUOOGBAWEKMWHGBOTG K XMPZTYYNQYCXNVTHWQ A
JUVUP COGUWRVKW OKQ
QHMKNJIIMYL ZSP
JCBFSS
XHYBJDKB
Y
TJJ
SRKKFMN IXR SUIGBQ S
LBGLU
MSCXO
W VPAWS JEMZLBRY FDSXDVFCVGVSS DHXDX GOQDJKXLUAY EOKXZRKERAKCQ



I dunno why... It seems the end is missing...
I have a Pentium 4, 2.4 ghz...
I am using windows xp...



-=-=-
Roger Federer is go(o)d.
But he is not alone.

Just relax... sometimes there's no need to argue.
Thu, 23 Aug 2007, 05:27
JL235
Yup, the end is missing. I wrote a simple Ruby program:

Ingenium, I presume you've tried running it multiple times? It always misses out the end?
Thu, 23 Aug 2007, 05:34
ingenium1
Yes, it always misses out the end :\
Thu, 23 Aug 2007, 06:02
Jayenkai
Whaa.....!?
Well, then... The random still works the same, just the For loop messes up..
That's good to know!!!

PS. For future reference, Diablo, Dos has the "cmp" command!!



-=-=-
''Load, Next List!''
Page : 1 2 Next
Prev