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

#1181
Switching
Code: ags

 if (player.ActiveInventory == iMedallion)  {

to
Code: ags

 if (player.HasInventory(iMedallion) )  {


should do the trick.
#1182
Haha, damn  ;D

me fixes.
#1183
Code: ags

function region1_WalksOnto()
{
  if (player.ActiveInventory == iMedallion)  {
    player.ChangeRoom(11);
  }
  else {
    player.Say("I feel drawn to something in this room");
    player.Say("I really want to find out what it is");
  }
}


If you indent you code, you don't run into bracket problems that fast.

Argh, Khris... you're too fast for me!
#1184
Isn't the AGS E3 called Mittens?? You attend, you show your stuff around - you don't... well then you do not do it ;)


In terms of authority...
Wanted to do a game with the NES palette:


Stopped it because it took too much precious time from ShattenReyze.

@Eggie: Please finish either a game or a cartoon, your style is awesome!
#1185
@Khris: your code doesn't work too for exactly the same error I'm experiencing. I can't believe that I've reformatted that code block  :=

@Duals: Look at this thread. Steve's code is pretty close to what you're trying to achieve.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42122.0
#1186
Sorry, I can't get it to work. I created a sample project and pasted Matti's version of your code in it. But it crashes as this line, as soon as I hit a key:
Code: ags
scale=DynamicSprite.CreateFromDrawingSurface(bg, 0,ax,  320, 240);


This is because ax can have a negative value by pressing down and the drawing surface immediately gets out of bounds.

It's a bummer that you've edited your posts, so that I can't access a working version.

#1187
Look, I made a compressed version. It saves space and is err.. good to be shared ???

Code: ags

int ax, ox,fxx=25, fyy=0, fww, sections=20, d=20, ad;DynamicSprite*scale, res, parts[];
DrawingSurface*bg, fx;float rw=5.0, rh=1.0;function room_Load(){  bg=Room.GetDrawingSurfaceForBackground();  
object[0].Clickable=false;  parts=new DynamicSprite[sections];}function room_RepExec(){  
if (ax>Room.Height-240)  {ax=Room.Height-240;  }  while (ad!=sections)   {    
int sze=(240/sections); float ratew=rw/IntToFloat(sections);    
float rateh=rh/IntToFloat(sections);    scale=DynamicSprite.CreateFromDrawingSurface(bg, 0, ax, 320, 240);    
parts[ad]=scale;    parts[ad].Crop(0, (sze*ad), 320, sze);    
parts[ad].Resize(parts[ad].Width-(sections-ad)*FloatToInt(ratew)), parts[ad].Height-((sections-ad)*FloatToInt(rateh)));    
fx=res.GetDrawingSurface(); if (ad>0){fww=(parts[ad].Width-parts[ad-1].Width)/2;}
fx.DrawImage(fxx-fww, fyy+parts[ad].Height-1, parts[ad].Graphic);    
fyy=fyy+parts[ad].Height-1;fxx=fxx-fww;ad++;}  ad=0;  
fx.Release();  object[0].Graphic=res.Graphic;  object[0].SetPosition(0, 240);}function on_key_press(int keycode) 
{if (keycode==eKeyUpArrow) ax+=d;if (keycode==eKeyDownArrow) ax-=d;}


I'm sorry that this didn't help at all, but
Quotewhen it comes to debugging and sharing the code, is the single most useless and annoying thing in the universe,
equals
QuoteThe world's a disc
#1188
Maybe you can also learn something useful from Easy3D.
That's  mode7 completely written in AGS Script:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26130.0
#1189
I suppose that only makes sense, when the Allegro Android port is done ;) But having AGS on touchscreen device would be great.
#1190
Screw the PSP, finally some video footage ;D

But it's still really really cool. If you could also port it to Dingux (Mips as wel), I could play it on my arcade :D That would be truly awesome!
#1191
The Rumpus Room / Re: Happy Birthday Thread!
Sat 04/06/2011 18:26:47
Happy Birthday Rim Jeed!

And a happy belated to Bicci!
#1192
Critics' Lounge / Re: walk on the giant tree
Tue 31/05/2011 19:35:57


There you go ;)
#1193
I've now implemented the suggested changes and here are the results:

No changes: 15.2s loading time
Replaced BitStringToInt with "magic" ( info & 1023;) and applied it to layers 1+2: 8.2s
Replaced BitString completeley: 1.3s
Replaced BitString completeley and replaced ReadDoubleWord with ReadRawInt: 0.2s

I'm speechless and have updated my avatar :D


Thanks a ton, all of you! I'd never thought that map loading could be that fast. Otherwise I've never asked for a plugin. And apologies to Wyz that I've wasted your time... sorry pal. I'll now go and learn about bitwise operations.


..yaay! ;D
#1194
First of all: wow!  :o

I'm sorry that I can't offer much help, as this is way out of my league. But I can offer some more stuff to read:
http://roguebasin.roguelikedevelopment.org/index.php?title=Articles#AI

At least those guys made me understand A* and they have a few article about LOS and FOV.

*pressing thumbs that those screenies make it to a final game*
#1195
The Rumpus Room / Re: Happy Birthday Thread!
Fri 27/05/2011 21:36:35
Aaand a happy one to Sparky  :D
#1196
Oh, it seems that I've been a bit confusing here. Let me explain:

I've a map format (default GBA, no promotion specialty), which looks like this:


Position(bytes)TypeDescription
$00 DoubleWord Number of tiles in a row(width)
$04 DoubleWord Number of tile rows (height) 
$08 Word width * height Word values where each value is divided into Bit sections 
0..9 tile index
10 flag if the tile must be displayer mirrored horizontally
11 flag if the tile must be displayer mirrored vertically
12..15 unused   

In order to process that file Khris was kind enough to provide the functions. PM could also export .txt files, but processing these took even longer.

The next step is that a level consists of 5 maps (layers), all in the same format and the same dimensions. Layer 1 + 2 = background and foreground tiles
Layer 3 = Items, Objects, Platforms and Waypoints
Layer 4 = Player, enemies and other characters
Layer 5 = hotspots

So for a level to load, parsing all these files is needed and takes a lot of time. Even more when doing it with AGS script :) And of course this data is stored in arrays, not in a stack.
Steve is definitely right and cooking Layers 3 to 5 will speed things up (and I think, I'll do that too). Still the big part is loading the tiles.


Now the second thing I'm trying to achieve has nothing to do with map loading itself. Once the player advances to the next level, I'm saving Items, Object and Platforms to stacks and reload them once the level is being entered again. That way the level design can be non-linear and enemies don't respawn. Same thing for items and other objects.

These are pretty small arrays stored into stacks and I already shrunk the stack separator, but it still takes some time to save and load these. In combination with the already slow map loading, it feels like forever on a slower CPU ;)


That's how things are working at the moments. In order to optimize things without having to write my own level editor, I thought switching from Khris' helper functions to compiled plugin functions could help.


@Wyz
Readword
Writeword
ReadDoubleword
WriteDoubleword
BitString
BitStringToInt

Those functions would be more than enough. The super-duper solution could of course be a complete map loader, but this is too much to ask for. Having those functions mentioned above would already be awesome²
#1197
Back then I already knew that nobody would take a look  >:(
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=40922.0

Just kidding ;D Here are the functions:
Painfully slow map loading: TENG::load_map_files
Stacks are used in teng.asc: TENG::save_room and TENG::load_room


edit: Forgot to answer Calin:
I still don't get how it would affect the speed in a good way. As far as I know AGS natively supports writing ints and strings. So for doubles and floats I'd still have to use strings and convert them in AGS script, right?
#1198
But the speed issue would still be present, right?

For example in order to travel back and forth between levels I save all data structs to files using Monkey's stacks module. That is so painfully slow (especially loading back the stacks into structs) that I'd rather have a plugin for that.

Okay, I'd ruin the fun for ScummVM, but for the key players (Windows, x86 Linux, Mac OS) I could simply provide custom builds.

Btw. couldn't both techniques be combined? Something like: plugin present -> use turbo, plugin missing -> long loading times, but playable.
#1199
The Rumpus Room / Re: Happy Birthday Thread!
Thu 26/05/2011 07:32:13
Happy Birthday, Wyz!  8)
#1200
Sorry, I should have mentioned it right away, that these functions were done by Khris.

@Wyz: Yaay, thanks for accepting the challenge :D
Could that future plugin maybe also have write functions? Pretty please? </puppy dog eyes>

PS: Is it my browser or the board converting "r - -" (without spaces) into the word "are"?

SMF spam blocked by CleanTalk