Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - KamikazeHighland

#1
I made these just now, completely by hand.  It wouldn't be difficult to write a function to do this automatically.  Algorithms aren't all that complicated and AGS already has all the tools needed, except for painting and detecting colors.  From there it's just a matter of speed.

http://i168.photobucket.com/albums/u193/kamikazehighland/65536.png
#2
Quote from: Alan v.Drake on Tue 03/04/2012 18:26:20
Quote from: KamikazeHighland on Tue 03/04/2012 16:04:09
If it were possible to both paint and detect absolutely every RGB value (255,255,255) of each color within AGS it'd be really easy to make your own filters using AGS.

Sure, if you wanna make a stop motion game. A filter needs processing power, the only sensible choice is to implement it in the engine source.

- Alan


If you could call for processing power from within AGS it'd be easier to customize filters and shaders for what works best in different games.  Then people who don't know c++ could make something without borrowing someone else's source code.
#3
If it were possible to both paint and detect absolutely every RGB value (255,255,255) of each color within AGS it'd be really easy to make your own filters using AGS.
#4
It's not about large numbers, it's about accuracy, and uncertainty.  When you multiply or divide ints or floating point numbers more than once, multiple rounding errors can creep up in no time at all.

Multiple registers, you say?
#5
Necessary?  No.

I don't know c++, and it looks hard to learn.   :-\

I'm finished.
#6
Well, I don't like for math to ever be wrong.  ;)

I've actually finished with all four arithmetic operations for non-negative, non-decimal numbers of any size.

But thank you anyway.
#7
I wrote a program to multiply or add any two numbers where neither is negative or has a decimal.  It's the equivalent of pen and paper arithmetic, so it's slow but at GameSpeed 40 it can multiply two 155 digit numbers 100 times in under a minute and is never wrong.

I don't -really- need to use numbers beyond maybe 20 digits each or do it very often, my only concern is that when I script to multiply or add two numbers the answer is never wrong.  Normally ints will be wrong beyond â€"2,147,483,648 to 2,147,483,647 and I cannot trust floats.  I don't need to use negative numbers or decimals at this point.

I've come up with better ways to multiply, subtract and divide, but I'm stuck on addition because carrying is slow and I can't find many resources on how to do that quicker.

I'm mostly just looking for tips or hints at this point.  Maybe someone's already had to do this and come up with ways how?
#8
Yes!  Thank you!
#9
This works fine:

float float1 = 3.75;
float float2 = 0.25;

Even FloatToInt(float1, eRoundNearest)


This, however:

if (3.0 >= float1 >= 2.0 && 3.0 >= float2 >= 2.0){
}

Type mismatch: cannot convert 'int' to 'float'

What am I not seeing?
#10
Thanks!  I'm working on fitting this to what I need but this is pretty much solved.
#11
I'm wondering if anyone's ever had to arrange ints, floats or strings in numerical, alphabetical or alphanumerical order?  And if so how did you do it?

Not the names of the variables but the actual values.

Edit:  I see how to do it with strings using CompareTo.  Any hints or tips are appreciated.
#12
Well I'll probably just abandon structs for now and do everything as dynamic arrays, or remove information from memory more quickly.  The struct alone takes up 40mb so obviously even three would take up 120mb...

Thanks for the reply!
#13
There've been a few topics on this, but I'd like any new information anyone might have.  This is the code that works fine:

struct Example {
 int PropertyAofSubstruct[256];
 int PropertyBofSubstruct[256];
 int PropertyCofSubstruct[256];
 float Property1ofSubstruct[2560];
 float Property2ofSubstruct[2560];
 float Property3ofSubstruct[2560];
 float Property4ofSubstruct[2560];
 float Property5ofSubstruct[2560];
 float Property6ofSubstruct[2560];
 float Property7ofSubstruct[2560];
 int PropertyDofSubstruct[256];
 int PropertyEofSubstruct[256];
 int PropertyFofSubstruct[256];
 float Property8ofSubstruct[2560];
 float Property9ofSubstruct[2560];
 float Property10ofSubstruct[2560];
 float Property11ofSubstruct[2560];
 float Property12ofSubstruct[2560];
 float Property13ofSubstruct[2560];
 float Property14ofSubstruct[2560];
 int PropertyA[256];
 int PropertyB[256];
 float PropertyI;
 float PropertyII;
 float PropertyIII;
 };
Example examples[256];

If I make either of two changes:

Replacing each [256] with [2560] or replacing the number of instances of the struct:
Example examples[2560];

I get this, which many have probably encountered:
Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Version: AGS 3.2.1.111

Or if I have just enough room I can store a few floats before the running program crashes saying the error is in the line it stopped writing.

The only reason I started a new thread is because it's been said there should be no limit so I'm a little confused on that.  I was able to bump the limits up once I deleted some pictures.  I realize I could settle for less but what's the problem?
#14
Awesome, thanks!
#15
Is there a way or method to round floating point values without converting them to integers?  Other than by doing this:

IntToFloat(FloatToInt(var1, eRoundUp))

Unless this isn't inefficient, or if it's the most efficient way.  This is rounding the float value and then using it again in a function.
#16
I'd like to allow a high degree of customization, which means having a lot of information to keep track of, little of which would be pertinent at any one moment.  I haven't decided on specifics, but I'm considering things like custom characters, custom items, custom inventories, the total number of which would grow with the amount of time played.  This information would be indefinite.

Since most of it would be unnecessary to have in a script I'd save what's not being used to several files so that, when something needs to be used, there'd be chunks of information to go through but nothing too big, and everything else not being used would be saved outside of runtime and outside of saved games.  The saved games part is to make loading saved games easier as well as to allow information to be used across saved games.
#17
I'm saving information in a concise format, out of runtime and out of saved games as separate files.  I can see what's confusing you:  while I need to store a sequence of information in order, I only ever need to read small parts of it at once.  I.e. I'd save information as a string and save that string to a file, then later read that string and truncate as needed to only get the pertinent part of it.
#18
Nice!  You're right.  I knew the answer before I asked.  I was just thinking in order to read from the string I'd have to import the whole thing each time, but I suppose I don't.
#19
Lol.  That would work, but it's probably not necessary.  I can store the information in a long string and save that to a text file, it just won't be fun to read as text or friendly to import/export, but it will help for cross saved-game information.

Thanks.
#20
I don't understand how text files to store stats.  I'd open the file, append it and WriteInt with a new stat, then save it.  But how would I read from it?

All the numbers would be in order (i.e. 56, 78, 43, 97, etc...), but how would I then write a script that says something like: stringStat = value at line 7, or so?

How do I store information in sequence and then read it back based on it's position or line number?  I.e. Line 1 = 56, Line 2 = 78, Line 3 = 43, etc...

Or, if all the information was saved in sequence, how could I convert the text file into something AGS could read in order?

EDIT:
I guess, for now, I could save all the information as one long appended string and truncate it accordingly.  It'd be nice to use outside files, though.
SMF spam blocked by CleanTalk