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 - Janik

#201
Quote from: Pumaman on Tue 23/11/2004 22:08:49
You need the MS .net framework installed for this plugin to work.
I have .NET framework 1.1 installed and yet it doesn't work. I tried in both AGS 2.61 and AGS 2.62.

Oh well, if it comes to that, I may write an external application in VB that will handle moving/copy/renaming the media files. If I do, I'll make it available free, of courseÃ,  :D . For now I'm only in phase 0.1 of 10000 of my gameÃ,  :P so that's a while away...
#202
It sounds like exactly what I want, but after I copy the files and run the .reg file it doesn't load: I get a 'Can't create instance of plugin' error.

I'm using AGS 2.62. WinXP, SP2.
#203
Hi,

I know AGS theoretically supports plugins for enhancing the editor (I haven't seen any though).

What I'm wondering is if there is some sort of sound manager for AGS? Since you have to name your files SOUND#.mp3 etc., it seems to me that it will get awful difficult to keep track of them when you have a bunch. Any help for that?

Thanks!
#204
General Discussion / Re: Sprites in AGS
Mon 22/11/2004 04:26:25
Sometimes what appears to be black is slightly not-black (like RGB 0,1,0) because of various operations and anti-aliasing... You can maybe try using the magic wand with a tolerance = 0 to grab all the black background; if you see there is some next to the sprite that is not selected, then it is not quite black there.
#205
Your comment

GetGlobalString(17,class) ;  /This should be the word Warrior

is missing a slash:

GetGlobalString(17,class) ;  //This should be the word Warrior

Also, you'll want to put an "else" before displaying "it doesn't work".
#206
How about removing/disabling some of the features of the board. Some of the the things of dubious use are:

- The upcoming birthdays in the main page
- Those IM/and the other icons below poster's avatars
- Maybe removing avatars entirely?
- Fewer smileys?

That's all I can see for now...
Oh BTW it looks like the search function doesn't work when you ask "Topic Subjects only"

QuotePlease try again. If you come back to this error screen, report the error to an administrator

#207
And you could use a for loop a bunch of these, it would simplify your code
#208
No that's perfect! I number my sprite files X_001.png _002.png and so on in the order they are to be animated, so they are imported in the right order anyway. And you can choose the loop, and whether to append or replace, that's truly excellent!

I can't believe I missed that menu! Thank you very much!
#209
Hi,

I'd like to be able to add multiple sprites to an animation view at a time. I've tried selecting several (shift-clicking) and then double-clicking that, but it only adds the last frame. If double-clicking would add all selected sprites, in sequence, that would be great. Or, a button to "add selected sprites" would work too.

I have lots of animations with lots of frames, and I'm using "quick import multiple sprites" (which is great); but when it comes time to make an animation from, say, 8 views with 20 frames each, it takes a long time to double-click New Frame, then choose the sprite and double-click, and do that 160 times. I read the friendly manual but couldn't see a better way.

So if that's at all easy to implement, it would be great and would save a whole lot of clicking!

Thanks!

Janik
#210
You could use the Taylor expansion (I think that is how processors do this internally)

cos x = 1 - x^2/2! + x^4/4! - x^6/6! + ...

However you may run into trouble with integer overflow. Also, x is in radians so you'll need floating point or some fixed point scheme.
#211
Quote from: stuh505 on Thu 28/10/2004 21:28:51
Is this what you mean?

theta(t) = theta(t-1) + s(t-1) * timestep

Yes, if you have t as an integer. But you have to calculate the speed s

QuoteI think it would be easier to loop until theta(t) = theta(t-1)

That's equivalent to waiting for the speed to drop to 0, yes.

Quotebut how would s (dtheta/dt) work in this recursive equation?
You need to recalculate the speed s for each step,

theta(t) = theta(t-1) + s(t-1) * timestep
s(t) = s(t-1) + FUNCTION(s, theta) * timestep

where FUNCTION(s, theta) = ds/dt = F*sin(theta) - R*s

Note the cosine instead of the sine, that was an error above. Scratch that, sine is correct.

Quotei know that the equation describing its motion would be

theta(t) = Ae^(-Bt)cos(Ct) + D

where D = the angle that represents north

And B is the pendulum frequency, A is its amplitude. That is a correct result in the small-angle approximation. If your pendulum's amplitude is too large, then theta(t) is more complex. To put it in the case of a compass, if you only turn a few degrees at a time this works. In practice it's probably close enough even for large angles.

If you rotate past 90 degrees, however, the needle will have a different behavior: it will start out slow, accelerate more and more until reaching 90 degrees, and keep accelerating (with friction this may actually be decelerating) but slower.

#212
Quote from: stuh505 on Thu 28/10/2004 16:39:02
1.Ã,  To have torque that is proportional to the difference of the current angle and the desired new angle, that provides angular acceleration and is damped by friction...

2. To have the order of the sequence of frames to be played be determined by a function

So....I'm thinking it would probably be too difficult to implement the realistic method of acceleration into AGS, but I could live with just having constant velocity to make it rotate to the new position without any harmonic motion or damping (I don't know how to do this and I doubt anyone else does)
Hmm... I'm taking computational physics this semester, so let's see... You're describing essentially a damped pendulum:

define:

theta = difference between current angle and north
s = dtheta/dt, the angular speed

so your equations are

dtheta/dt = s
ds/dt = F*sin(theta) - R*s

where F = your force of attraction
and R = a coefficient of damping.

So when direction changes, your theta_0 is modified, and then you will integrate the equation numerically with a certain time step. The simplest algorigtm is this:

s(1) = s(0) + ds/dt * timestep
theta(1) = theta(0) + s(0) * timestep

and loop until s(n) is close enough to 0 (that is, the pendulum has been damped enough)

I'd recommend writing the program outside of AGS at first, just outputting s and theta as a function of time, to make sure it works before adding the graphics.

This isn't the most precise integration method, but I won't go into the 4th-order Runge Kutta method right nowÃ,  ;D
#213
As far as I can tell AGS can only get the system time down to the closest second, using GetTime.

My method shouldn't be framerate dependant, since, I believe but I'm not certain, script execution is blocking. So nothing else (in the game) would slow the calculation. If a background program is running and using up the CPU, then it would indeed throw off the calculation.

I just thought of something however - in the case of a gradual fading, this wouldn't work, since the screen still only displays at the rate set by SetGameSpeed (e.g. 40 times per second). So, no, there's no point in delaying less than 1 game cycle.
#214
I have an idea that might work as long as timing isn't critical (it wouldn't be very precise). How about running a calibration once, on game_start, something like (I don't remember the syntax for do while loops in c...) :

//Start counting at the beginning of a second
start = GetTime(3);
do
Ã,  now =Ã,  GetTime(3);
loop until now == start + 1;

//Count how many loops needed
start = GetTime(3);
count = 0;
do
count++;
Ã,  now =Ã,  GetTime(3);
loop until now == start + 1;

And then there are count cycles per second.

Then, do

for (i = 0; i < Milliseconds*count/1000; i++)
{
Ã,  now =Ã,  GetTime(3);
}

And that should be the right delay (haven't tested). Counting for 1 game cycle instead might be nicer since it wouldn't involve a 1 sec delay each time the game starts.
#215
Advanced Technical Forum / Re: Walkable areas
Tue 26/10/2004 03:14:29
Pathfinding is a major artificial intelligence issue in lots of games (I'm sure there's tons of stuff out there, in gamasutra for example). In  real-time strategy games many units move around a large map at the same time, so performance is important. In an adventure game it's only one character at a time, so it's less critical. Still, I've tried drawing labyrinth-like designs in AGS and the character navigates them perfectly, as long as they are more than 3-4 pixels wide.

#216
Quote from: Darth Mandarb on Mon 18/10/2004 04:48:01
I too am using this method to create shadows under my characters for 2 projects I'm working on.Ã,  It works great!
Are you making the shadow a part of the character sprite?

I'm thinking of making the character in one set of sprites; and a second character would be the shadow with his own sprites, for a couple of reasons:

1 - With the character with no alpha, anti-aliased scaling works, and that looks a lot better when scaling cartoonish characters. Especially with continuous scaling.
2 - The shadow can also be turned on and off as nessary (I'd use a property of walkable areas like "NoShadow", and some global script)

Then the problem remains of making 2 sets of sprites, and scripting it such that the animation matches, and the the shadow character follows correctly.

Hmm... Now that I think about it, it isn't even necessary to use alpha for a shadow-only character; you could just set the opacity to 50% or so and have an opaque black sprite.
#217
Looks great - but with that nice reflection of the hut you'll need to have the character be reflected in the pool too!  :o
Not impossible, but I imagine you'd have to make new views with all the sprites flipped up/down, and that would be a pain...
#218
That was it! It was that "feature" in photoshop 7 that was causing the problem. Here's some info I found on the net about it.

QuoteThe Targa file format specification reserves the fourth channel of Targa files for transparency. The Photoshop 6.x Targa plug-in, however, uses the fourth channel for an alpha channel.

The Photoshop 7.0 Targa plug-in conforms to the Targa file format specification, reserving the fourth channel for transparency

After installing the new plugin, it works fine now in AGS. Shadows under the character, yay!Ã,  :D
Edit: I see now how there's no anti-aliasing for the alpha sprites - is there a specific reason why that is?
#219
Hi, I'm having trouble getting Alpha channels to work with AGS and photoshop.

I made a crude character in photoshop 7, added an Alpha channel and painted it to make the player opaque, and add a semitransparent gray shadow. Here is the file:

http://www.dmgenie.com/ags/Test%20Alpha.psd

Problem 1: Photoshop won't let me save the Alpha Channel (the checkbox is uncheckable) when I "Save As" a .TGA or .PNG.

So I go to ImageReady and use Export Original to save as a TGA. That seems to work. When I import that into AGS, it asks "Use the alpha channel?". I say yes-Ã,  but the shadow is just a black, opaque area. I have transparency only with the BG color in the topleft corner, same as if I had no alpha.  >:(

Any hints? Is this an AGS problem or am I doing something wrong in photoshop? I couldn't search the forums because of some database problem, sorry.

Thanks!

Janik
#220
I get the same bug. I have a GeForce card too. I usually just test windowed anyway, it's nicer to be able to switch to something else without changing resolution.
SMF spam blocked by CleanTalk