home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


General Thread

by Aardappel on 01/05/2002 01:55, 15527 messages, last message: 03/01/2024 13:02, 11366920 views, last view: 05/02/2024 23:31

for questions, announcements etc.

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages

#14186: Re: Hashing

by Papriko on 10/31/2011 12:16, refers to #14185

I wanted to write my own pseudo-random generator (gonna get a simple algorithm via google).
I know there is the the rnd command, but I wanted to feed the generator with seeds. Rnd doesn't seem to provide such an option, so I need my own.

Usually those generators only accept integers, in some cases also floating point values, but clearly not strings. So I need to crush the input somehow that it ends up as integer.

reply to this message

#14187: Re: Login and mouse pointer probs

by jAZZbASS on 11/02/2011 16:09, refers to #14178

Actually, 10 years on a mac, not one virus, blue screen or any interference, and have sorted the mose pointer thing, it tuned out to be Command or apple key + tab, but not in full screen. Thanks though for all who responded. :-)

reply to this message

#14188: Re: Hashing

by MeatROme on 11/04/2011 10:39, refers to #14186

Papriko, just look in shared/tools.cpp - the rnd-function should be seeded already. But in the end such heavy-duty algorithms as hashing should not be run from CubeScript, a hardcoded one will be much faster .. shared/crypto.cpp already has such functions, like "hashstring" .. depending on what you actually want to do with your hash (whether it needs to be reversible, etc) a simple exposure of that function to CubeScript would be better. HTH

reply to this message

#14189: Re: Hashing

by Papriko on 11/04/2011 17:32, refers to #14188

I am no fan of engine modifications, even for such stuff. No, it is not because of the people screaming "hax0r!", it is because A) my C++ sucks too much to do so, B) I am missing several libs to compile Sauer at all and C) I'd like to keep my code usable for anyone. Guess I won't publish it, it's such a just-in-case story.

You said rnd is seeded already? Do you mean inside the engine or can I re-seed it with CubeScript?

It might be a heavy function, but I wasn't going to use it very often. For the planed purpose it might be called once in half an hour or so.

It does not need to be reversible either. As I said, I just want to mash it so that I can feed the user input as seed to the random generator. So it doesn't need to be a high quality function, it's enough when it returns an integer and constant output when the input is the same.
Basically it would be enough to give every char a number and then add them together, but then I worried about extra chars like color codes or ß. Especially the ß is annoying, cuz Sauer can't display it, but accepts it as input. I notice that when I make typos while chatting with others ingame.
Of course those chars can be skipped, but it would be nicer if not...

Overall thanks for your answer. (this time it's seriously meant)

reply to this message

#14190: Compiling

by jAZZbASS on 11/04/2011 20:07

Probably asking another dumb question, so apologies in advance, but can anybody tell me how to re-compile a .app (Sauerbraten.app) with my ammendments, using Xcode, and how to tell xcode (mac) how to use the make file. I cannot use "make" in terminal the command is not recognised. I have Code::Blocks,but both bits of software seen to be unresponsive ?

reply to this message

#14191: Re: Sauerbraten (OpenGL?) overrides color profile settings

by paulbhartzog on 11/04/2011 23:14, refers to #13791

When will this be fixed? it occurs on Mac also.

reply to this message

#14192: coop edit

by lewisnf on 11/05/2011 01:03

how do i change my sever from ffa to coop edit??

reply to this message

#14193: Re: Sauerbraten (OpenGL?) overrides color profile settings

by Zorg on 11/05/2011 01:03, refers to #14191

First of all: Kudos for finding this topic in the general thread!

It is already fixed in the SVN, at least it was for Windows last time I checked. I suppose the fix works for Mac, too, meaning the next release of Sauerbraten won't hijack the color profile settings.

You could, however, check the SVN (Mac-guide: http://ogros.org/tips-and-tricks/38-general/50-svn-mac.html) and see for yourself. If it is not working in the SVN: I'm pretty sure Eihrul will fix that, too :)

reply to this message

#14194: Re: Sauerbraten (OpenGL?) overrides color profile settings

by lewisnf on 11/05/2011 02:17, refers to #14193

i dont get it how does that help change the mode

reply to this message

#14195: setuniformparam?

by suicizer01 on 11/05/2011 02:22

After I've been testing the height-map options, I tried (as I already tried before but failed), working with the command "setuniformparam".
Somehow, it never gets used in any configuration for textures itself like in "package.cfg", neither in config-files of maps.
After reading the docs, I didn't become any more wise as I previously was (it's not really clear language to me).
Anyone has any idea what the real purpose of this command is?
I would be thankful if you would tell so.

reply to this message

#14196: Re: Compiling

by baby~rabbit on 11/05/2011 08:23, refers to #14190

If osx doesn't recognise 'make' then you haven't installed the developer tools. I believe anyone can download them from the appstore these days - might cost you $4, might not (and this forum is not the place to complain about that).

Generally one opens the xcode project and hits the build button, search the wiki and this forum if you hit any issues.

reply to this message

#14197: Help my Server doesnt reach Sauerbraten.org :(

by Foley on 11/05/2011 09:19

Hey i dont know what I should do :(
I have an Linux-Homeserver (behind an router) and given it free (with an dns-name and portfree) but anytime the server tells me that he couldnt reach the masterserver (couldnt ping sauerbraten.org).
I tried it with Sauer-Wiki and Google but noone has an answer.Now im asking the Developer Community for help.
Ive you have some ideas please write back or best send me an email (lukaswiedemann100@web.de).THX for your help.

reply to this message

#14198: Re: Sauerbraten (OpenGL?) overrides color profile settings

by Zorg on 11/05/2011 12:16, refers to #14194

What do you mean "change the mode"? In the currrent release, color profile settings in Windows OS seem to have no effect in Sauerbraten. In the SVN version, this is fixed, so the next release will work with color profiles.

reply to this message

#14199: I'm sick and tired of Sauerbraten...

by Sean Saliba on 11/05/2011 14:56

Make a better engine, this engine is start to run out of it's time, looking at more professional games out there mocks this old and unadulterated engine.

I'd say start over and write a full blown commercial game with full on single player support and coop multiplayer online, that's what make games like COD and BF so good, I don't see why don't you try to do the same, sorry but this game and it's engine is cheap off crap and I don't see why anyone want's to use it or much less play it while there are better games out there.

Scrap this game/engine and start over, trust me. ;(

reply to this message

#14200: Re: Hashing

by MeatROme on 11/05/2011 14:59, refers to #14189

Uhm, we seem to be talking at cross purposes.
I gave you a source-file re:rnd-is-seeded .. so yes, it's by the engine, and no, you can't re-seed it.
re:engine-mod - my comment was meant "in general", as the reasons I gave should have made clear: such operations are best performed from (compiled) C rather than (interpreted) CubeScript.

I still have no real clue what exactly you're trying to do, what you want your hashing function to do or why you're so hooked on re-seeding the randomness of rnd. Some background information might help.
The way you were talking about assigning letters values it almost sounds like you might even be happy with ROT13. Hail Caesar! Mortituri Te Salutant!
.. because, as Ovid knew:
Est qui nequitiam locus exigat!

;)

reply to this message

#14201: Re: Hashing

by Papriko on 11/05/2011 15:10, refers to #14200

I try to make a random map generator. Such already has been there for Cube 2, I simply try it out to train my scripting.

Since it is a random map generator, it uses some rnd here and there.
I would like to have it to have a seeding function, so you can recreate maps in case you liked the result you had.

Making up some bunch of numbers is not really that great, so it shall accept strings as input too. The string is converted into a sorta-pointless integer. That integer is used as seed for the random command, the random command is used by the map generator, you end up in a seeded map.

Is this now a bit better explained?

reply to this message

#14202: Re: coop edit

by tempest on 11/05/2011 15:33, refers to #14192

/mode 1; map somemap

reply to this message

#14203: Re: Hashing

by tempest on 11/05/2011 15:41, refers to #14201

No problem then, write your own rnd replacement in CubeScript. A typical pseudo-RNG requires things like multiplication, addition, bytewise and/or and shift - IIRC all of those exist in CS.

I'm not sure how you could generate a number from a string in CS, though.

reply to this message

#14204: Re: I'm sick and tired of Sauerbraten...

by Razgriz on 11/05/2011 17:07, refers to #14199

Good riddance then, go and play Call of Duty and Battlefield like you said.

People like you do not belong in places such as this.

reply to this message

#14205: lol, too many to reply to.

by Sub-Zero on 11/05/2011 23:02

@Papriko: as yes, random maps, as you have said has been done, i don't know if we had one before i suggested the idea to a friend of mine who made it happen, thank you Roto-Rooter (ref http://quadropolis.us/node/2769 )

@Sean Saliba: yes please do get out.
*Sub Zero uses his freeze power to freeze Sean Saliba in place and then uses Razgriz giant cock to break the ice therefore breaking Sean Saliba in thousands of little pieces. Sounds ring off "Sub Zero and Razgriz win, FATILITY!"*

@AlternantLives: lol, "enjoy your viruses" who says i run windows either?

reply to this message

Go to first 20 messagesGo to previous 20 messages    Board Index    Go to next 20 messagesGo to last 20 messages


Post a Message

Username

Email

Subject

Body

4 times 9 =


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53830274 visitors requested 71602905 pages
page created in 0.244 seconds using 10 queries
hosted by Boost Digital