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 - Monsieur OUXX

#3641
Quote from: Meowster on Sun 13/06/2010 16:09:10
Unfortunately I'm woefully crap at painting

Not a real, helpful critique... But I love it! Reminds me of Alone in the Dark.
#3642
Quote from: Ryan Timothy on Fri 11/06/2010 19:51:23
Does it matter?

Anyway, basically this:
Code: ags

int test[Game.InventoryItemCount];


Instinctively, I'd say it's because you can only use a real number when you declare that kind of arrays. If you want to use a variable as the size of the array, then you have to use dynamic arrays, created inside a function.

Either :
Code: ags

int myarray[666]; //anywhere in the code


Or:
Code: ags

int myarray[]; //anywhere in the code

function foo() {
   int size = 666; 
   myarray = new int[size];
}


...But you can't mix those 2 methods.

If I'm wrong, then it means AGS has changed a lot since the last time I used it!
#3643
Quote from: Wyz on Fri 11/06/2010 17:09:43
there are issues with dual core processors (affinity).

Could you elaborate?
#3644
Quote from: Ryan Timothy on Fri 11/06/2010 17:59:40
I was trying to create an array using Game.InventoryItemCount as the size

Could you show your code?
#3645
Quote from: abstauber on Fri 11/06/2010 10:30:12
I use a midi for timing the notes and check the ogg position to see if they are still in sync.

Thanks for your sound advice.
And thanks to Wyz and Jim Reed!
#3646
Quote from: abstauber on Fri 11/06/2010 09:19:44
Though I'd suggest that you use an ogg with the directx hardware mixer. This should be most accurate.

Possible, but wouldn't it use a lot more resources than the MIDI?
That's where I really need the opinion of someone who often uses the music and sound functions (or are you, abstauber?)
#3647
Quote from: Wyz on Thu 10/06/2010 15:15:12
Play a midi and fetch the precise position at the start and end off the routine.

Quote from: abstauber on Thu 10/06/2010 14:54:28
what if you set the gamespeed to 60 and add a counter. Then you could check if it really took 1 second for the counter to reach 60.

Bumping. Any other ideas? If not, I'll consider the case as solved.
In any case, thank you guys, both are very good.
#3648
Quote from: Wyz on Thu 10/06/2010 15:15:12
Play a midi and fetch the precise position at the start and end off the routine.

That's exactly the kind of powerful workaround I was looking for.
Does anyone have enough experience of the MIDI functions to tell :
1/ If they're fast to call, or if that external call is awfully slow?
2/ If they're accurate, or if they can be significantly late or in advance (since they surely rely on a separate thread) ?
#3649
Quote from: abstauber on Thu 10/06/2010 14:54:28
hmm... what if you set the gamespeed to 60 and add a counter. Then you could check if it really took 1 second for the counter to reach 60.

I'm not sure if you had a good idea, or if it's redundant with the idea I exposed in the post starting with "I had an idea"?
Could you elaborate? Thanks!

EDIT: Our ideas are similar in their underlying mechanism, but the final approach is slightly different :
Both ideas start by overclocking the game engine, however :
1/ You measure the delay that follows the incapacity of the game to meet the requested speed.
2/ I prevent the game from doing anything for "long" periods of time, and then measure how much idle time it had.
#3650
Quote from: Jim Reed on Thu 10/06/2010 13:13:11
Scorpiorus scripted a FPS counter

Unless I think of a clever way to use it, that wouldn't help, because it can only calculate (litterally) the number of frames rendered per seconds, and not the time elapsed individually on each frame (the result of the calculation "1/FPS" would be an average).

If I cannot know the time spent for one frame, I can't know either the time spent on a specific operation within the script during that frame.

A (brutal) workaround would be to perform the treatment I want to measure once every 2 frames, and all the rest of the processings during the remaining frames. It would allow me to roughly measure how much time is spent on my treatment - but until I'm not sure if there's a better solution, I'd rather not do that.
#3651
With all this evil nudity, I'm surprised nobody posted an overpainting yet. :-)

EDIT: That's exactly what abstauber just said :-)
#3652
I had an idea, tell me if it sounds crazy :
1. Push the SetGameSpeed to the maximum.
2. Put a "Wait" In the global "repeatedly_execute" to make sure the engine won't try to redraw everything until it explodes. I can choose the value I give to that "Wait" to regulate the actual game speed.
3. Put a counter in the "repeatedly_execute_always". If everything's fine, this counter should tick at the speed defined in the "SetGameSpeed" of step 1.
4. Put the loop I want to measure in "repeatedly_execute"

To measure how long it took to execute the loop, all I have to do is to divide the number of ticks elapsed between 2 "repeatedly_execute" by the speed defined in "SetGameSpeed".

Notes:
a) It won't give me a time in seconds, more of a relative time compared to the overall game speed, but it's OK.
b) This works only if the FPS doesn't go so low that the actual game speed goes completely different from the speed defined in "SetGameSpeed". I need to make sure my treatments are fast enough.


What do you think?
#3653
Hi,
I'd like to measure the time that elapses within a loop. the loop is executed only once between each rendering by the engine (in other words, it would be executed at each call of repeatedly_execute_always).

So far, let me know if something I said doesn't make sense.

It doesn't matter what the loop does. What's important is that I want to measure how long it takes. And since it's executed at each frame, you can assume that the execution time is relatively small compared to the global time spent on other scripts.

You start to get it: the time I want to measure is very short.

So my question is : What tool would you recommed to measure that? Is a timer accurate enough*? What else would you use?

* If the error of the measure is higher than, let's say, 3  times the time that I want to measure, you'll understand it's not acceptable. However I'd tolerate measures with 50% error (0.5 times the real value)  to 100% error (1 time the real value).

EDIT: I'd tolerate a frame rate as low as 15 fps. Which means that I'd spend roughly 50ms for the total script execution at each frame. If I assume the loop I want to measure can take 10% of that time, it means the times I want to measure can be as small as 5ms. Let's say 1ms for better results.
#3654
A rabbit and a microwave. How provocative. ;-)
#3655
Advanced Technical Forum / Re: projectiles 2
Wed 09/06/2010 08:37:46
I don't know exactly how your code works, but are you sure it's not simply that you give wrong values to x and y when you initialize them, causing the object to appear immediately outside of any walkable area (and it's not displayed at all) ?
#3657
I want to meet Icey in real life.
Let's organize a webcam conference with all the forumers... and him. :-)
#3658
Actually it takes 4MB because the integers are stored on 4 bytes :-)
(You have no idea the time I spent doing nerdy tests on that scripting language  :D)

...And using a huge array actually is the workaround   ;)  (I'm using algorithms that compensate low speed with high memory usage).

Anyway. I'll survive. I was just sharing my pain ;)
#3659
I was so proud that my dynamic allocation system didn't rely on static arrays anymore, but on dynamic arrays instead.
And then realized that dynamic arrays can have a size only up to 1,000,000 elements - thus dividing the power of my module by 20 after a long and painful refactor.

This post has no other object than to whine.  :)

I'll even add [SOLVED] in the subject, to close it definitely.
#3660
General Discussion / Re: Tycoon Games
Fri 28/05/2010 11:53:04
Quote from: Oliwerko on Fri 28/05/2010 09:25:06I really much liked Pizza Tycoon


Haha, I didn't think anybody would remember that one.
Anybody for "Macchiavelli the Prince" ? (just kidding)
SMF spam blocked by CleanTalk