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

Topics - Khris

#21
Hints & Tips / Death - Episode One
Tue 22/06/2010 11:27:50
I got the
Spoiler
letter from the emo and need to find the hideout.
[close]
I have no idea where to start.
Spoiler
Can I get rid of the guard somehow? The emo watched my so he's probably near the elderly home.
[close]
#22
I can't for the life of me remember the title, thought it was something along the lines of infinite ammo but, no.

It's a shoot'em up similar to Asteroids, but you can extend your ship by adding cannons everywhere; all ships are made of squares and triangles I believe, and the bosses were huge, showering the screen with bullets and rockets, and you could take them apart shape by shape.
The graphics were green lines on black background, iirc.

I believe the bosses were generated randomly so you could literally play forever, this might be hinted at in the title, not sure though.

Does any of you know the game?

Thanks for reading!
#23
So, as some of you may know, I'm currently in the process of trying to replicate Chrono Trigger's tile engine.
It uses four layers combined with two zPlanes and a priority mode for every tile to give the impression of having much more layers.
Basically, I have two layers of ground tiles, stored in map-sized DynamicSprites, one holding the base floor, the second one holding details or foreground objects.
Then there's two sprite layers, one for each zPlane. Those contain the character sprites, either in full or with their sprite being distributed among them tile by tile. These layers are also stored in DynamicSprites, but they are redrawn every game loop.

When it comes to drawing the screen, I loop through every tile, determine the order of the layers depending on its priority flags, then compose the final tile and draw it to a fifth DynamicSprite.
After the loop, this DynamicSprite is cropped and displayed.

Here's the relevant portions of code:

Code: ags
DynamicSprite*t;

void _compose_tile(int x, int y, DrawingSurface*d1, DrawingSurface*d2, DrawingSurface*d3, DrawingSurface*d4) {
  DynamicSprite*temp;
  DrawingSurface*ds = t.GetDrawingSurface();
  ds.Clear(Game.GetColorFromRGB(255, 0, 255));
  temp = DynamicSprite.CreateFromDrawingSurface(d1, x, y, tiledims, tiledims);
  ds.DrawImage(0, 0, temp.Graphic);
  temp = DynamicSprite.CreateFromDrawingSurface(d2, x, y, tiledims, tiledims);
  ds.DrawImage(0, 0, temp.Graphic);
  temp = DynamicSprite.CreateFromDrawingSurface(d3, x, y, tiledims, tiledims);
  ds.DrawImage(0, 0, temp.Graphic);
  temp = DynamicSprite.CreateFromDrawingSurface(d4, x, y, tiledims, tiledims);
  ds.DrawImage(0, 0, temp.Graphic);
  ds.Release();
  temp.Delete();
}

void _str_vs::ReDraw(bool update_guis) {
  if (!this.maploaded) return;
  
  DrawingSurface*rds = Room.GetDrawingSurfaceForBackground();
  rds.DrawingColor = this.bgc;
  rds.DrawRectangle(this.x, this.y, this.x+this.w-1, this.y+this.h-1);
  
  DynamicSprite*map = DynamicSprite.Create(this.tw, this.th, false); // holds final map
  DrawingSurface*ds = map.GetDrawingSurface();
  ds.Clear(0);
  ds.DrawingColor = 15;
  t = DynamicSprite.Create(tiledims, tiledims, false);
  
  // update character layers Z1&Z2
  this.DrawCharTiles();
  
  // draw all layers together
  DrawingSurface*l1 = L1.GetDrawingSurface();
  DrawingSurface*l2 = L2.GetDrawingSurface();
  DrawingSurface*z1 = Z1.GetDrawingSurface();
  DrawingSurface*z2 = Z2.GetDrawingSurface();
  
  int x, y, i, zp, zm;
  int xx, yy;
  while (y < mapheight) {
    x = 0;
    while (x < mapwidth) {
      i = y * mapwidth + x;
      xx = x*tiledims;
      yy = y*tiledims;
      zp = Tile[i].zplane;
      zm = Tile[i].zmode;
      
      if (zp == eZplaneN) {
        if (zm == 0)      _compose_tile(xx, yy, z1, l1, l2, z2); // (Z1 sprites below ground)
        else if (zm == 1) _compose_tile(xx, yy, l1, z1, z2, l2); // (high ground above all sprites)
      }
      else if (zp == eZplane1) {
        if (zm == 0)      _compose_tile(xx, yy, l1, l2, z1, z2); // (all ground below sprites)
        else if (zm == 1) _compose_tile(xx, yy, l1, z1, l2, z2); // (high ground above Z1 sprites)
      }
      else if (zp == eZplane2) {
        if (zm == 0)      _compose_tile(xx, yy, z1, z2, l1, l2); // (all ground above sprites)
        else if (zm == 1) _compose_tile(xx, yy, z1, l1, z2, l2); // (ground over sprite)
      }
      else if (zp == eZplaneT) {
        if (zm == 0)      _compose_tile(xx, yy, l1, z1, l2, z2); // (all ground above sprites)
        else if (zm == 1) _compose_tile(xx, yy, z1, z2, l1, l2); // (all ground above sprites)
      }
      
      ds.DrawImage(xx, yy, t.Graphic);
      if (zm) ds.DrawPixel(xx+1, yy+1);
      
      x++;
    }
    y++;
  }
  ds.Release();
  t.Delete();
  
  // canvas change to reflect viewscreen size and offset
  map.ChangeCanvasSize(this.w, this.h, this.ox, this.oy);
  rds.DrawImage(this.x, this.y, map.Graphic);
  rds.Release();
}


I can already think of two methods of optimizing this:

- Only draw the part of the map that's actually visible on-screen. This is part of my to-do list anyway.

- When I redraw the sprite layers, I loop through all tiles that contain part of a sprite. I could mark them, then skip unmarked ones inside _compose_tile.

The thing is, given that the screen will show around 300 tiles, I'll be in the range of over a thousand DynamicSprite.CreateFromDrawingSurface and DrawingSurface.DrawImage commands each loop, even with those optimizations.

I can't think outside of the box any longer, so I'm glad for any input on this. :)

EDIT:
I've actually just thought of another way immediately after writing this.
There's no need to redraw tiles without sprites, so I could skip redrawing those every loop using flags marking tiles as dirty for the whole map.
#24
This module supports up to 99 analog style counters:

   

Usage:

To add a counter to the game, first define a global integer variable using the Global Variables pane (or the import/export method).
Then call
  VARIABLE = CreateCounter();
The next step is setting up the counter. Add a Gui, then call:
  Counter[VARIABLE].Setup(GUI*gui_to_use, int width_in_digits, int initial_value = 0, int delay = 5);
The Gui is resized automatically, initial_value and delay are optional.
A delay value of 5 is pretty slow, use lower values to make it faster. (5 means the counter is scrolled by one pixel every five frames, -2 will scroll the counter by 3 pixels every frame).

To change the default appearance (see first example image), use
  Counter[VARIABLE].SetAppearance(FontType font, int font_color, int bg_color);
The border is drawn using the font color.

To set/scroll the counter, there are three possibilities:
  Counter[VARIABLE].SetValue(int v);
                   .ScrollBy(int by);
                   .ScrollTo(int target);
SetValue changes the counter immediately to v, ScrollBy scrolls by times, ScrollTo scrolls to target. Obviously, ScrollBy() allows for negative values. Currently, it's not possible to scroll below 0 or above 10^digits-1 though.


Possible future features:
-support putting counters on Gui buttons
-allow for negative values
-change counter array to instances
-expand appearance settings


  DOWNLOAD MODULE
#25
Critics' Lounge / German Cards
Thu 04/02/2010 22:09:36
So. I'm planning to do the best card game of all time, Schafkopf, as a single player game. The real challenge here is coding the AI.
Since I'm a bit afraid of starting that, I've decided to draw the cards first.

Here's the Seven of Bells:

 

I don't really like the not-really-circular shape of the Bell, but with that dimensions, the current line seems to be the best approximation of a circle. Also, the lower, red part is supposed to show leaves; those have a line down their middle, but it's really hard to draw that without using several more colors.

Well, I'm open to ideas and will put new cards in this thread also.



Alright, I've just realized the actual cards I used as reference seem to feature some alternative design. Oh well.
#26
For what I'm trying to do I want to read two files off my HD. The first is a PCX image (containing tiles), the second one is a raw file which contains dimensions, then specifics of the tile map. Those are stored using words.

Here's the relevant bit of code:

Code: ags
bool ReadMap(String filename) {
  File*f;
  String fs;
  
  [# SNIP (DynamicSprite is read and displayed fine) SNIP #]
  
  fs = String.Format("tiles/%s#map001.map", filename);
  error = "Map file not found";
  if (!File.Exists(fs)) return false;

  f = File.Open(fs, eFileRead);
  error = "Error opening map file";
  if (f == null) return false;

  int width = f.ReadDoubleword();
  ...


As you can see I've put in several checks. Everything works like it should until I try to open the file for reading.
The manual doesn't mention anything AGS not being able to open raw files, so I assumed those would work fine. However, this doesn't seem to be the case.

I've uploaded the file here (had to remove the hash character from the filename in order to put it on my webspace): RAW FILE

Just to clarify:
1. AGS says the file does exist, so this isn't a problem with the filename.
2. I've double checked that the file isn't open in another program.
#27
Choose one of the original three wise men or imagine how they'd look if Jesus was born today.

Maybe they'd represent some entirely different faction? Emos? Nerds?

Pixel pushers will like a restriction to 150x150 @ 32 colors.
Hi-res artists are welcome to use the limits of their system, although the size should be kept at reasonable dimensions to use the sprite as an in-game character.

Happy spriting!

edit: Heh, corrected date :)
#28
Dynamic Sprite Rotation Module v0.1 by KhrisMUC

Tested with and coded for AGS3.0 RC1 - Can be used freely. No credit required.

DOWNLOAD
(includes the following documentation and example room script)


- DynamicSprite* DynS.CreateFromExistingSprite(int slot, optional bool preserveAlphaChannel)

Replacement for the built-in function, used to create a new dynamic sprite.
Returns the created dynamic sprite just like the standard function.
*Must* be used to create the sprite in order to rotate it using the new function.
To use e.g. DynamicSprite.CreateFromBackground() instead of an available slot, call DynS.CreateFromExistingSprite() afterwards using the first sprite's graphic as slot parameter.
Note that in this case the first sprite has to be kept in memory! You have to rotate a second sprite!



- DynamicSprite* DynS.Rotate(DynamicSprite*dys, int offset)

Returns the rotated dynamic sprite. dys is the current sprite, offset the angle to rotate it by.
Note that you must set the original sprite!
Example:
 my_sprite=DynS.Rotate(my_sprite, 10);    // rotates my_sprite by 10 degrees


- int DynamicSprite.XO(), int DynamicSprite.YO()

When drawing the (rotated) sprite, add these to the coordinates to prevent the sprite from moving about.
Example:
 ds.DrawImage(100+my_sprite.XO(), 100+my_sprite.YO(), my_sprite.Graphic);


- int DynamicSprite.XC(), int DynamicSprite.YC()

Same as above but centers the (rotated) sprite at the given coordinates.

Note that XC, YC, XO, YO work for all dynamic sprites, not just rotated ones.
#29
I've coded a small ray caster.
It was set to use DirectDraw by default and the result looked like this:


Since I've used a rather arbitrary method for calculating the color, I didn't mind it too much.

When I switched to Direct3D, suddenly I got this:


So my code does work as it should.
I'm just a bit surprised by the results.

Here's a snippet:
Code: ags
        else lightness=Maths.ArcCos(v[hr].dot(rr))/(Maths.Pi);
        lightness=1.0-lightness;
        lightness=lightness*light.lightness;
        int are, g, b;
        are=FloatToInt(IntToFloat(s[fnd].cr)*Maths.RaiseToPower(lightness, red), eRoundNearest);
        g=FloatToInt(IntToFloat(s[fnd].cg)*lightness*red, eRoundNearest);
        b=FloatToInt(IntToFloat(s[fnd].cb)*lightness*red, eRoundNearest);        
        RawSetColorRGB(are, g, b);
        RawDrawRectangle(x, y, x+renderstep-1, y+renderstep-1);


(You can ignore the red variable since it's set to 1 by default.)
lightness is somewhere between 0.0 and 1.0, s[X].cr/g/b define the color of the sphere.

Any explanation? :)

Edit: Actually, after posting this, I came up with a possible explanation. Could it be that the r,g,b values are rounded somehow? To bigger steps than 1? That would explain the huge uni-colored areas and the hue jumps.
#30
I've encountered something strange yesterday.

Among my favorite puzzle games are the Picross ones by Nintendo.
I've written a solver with AGS that relies heavily on while loops and recursion.

For testing & debugging purposes I had included some Wait(1); commands during various loops so I could follow on screen what was happening.

After I got rid of the bugs, both puzzles I entered were solved correctly; everything appeared to work fine.
Now I wanted to test the speed and removed the Wait(1);s. Suddenly the while loops inside the recursive function threw mentioned errors.

The code is strictly serial, there's no rep_exe stuff or anything like that. All while loops start and end at a low integer.
I thought maybe the recursion was too deep, but after I rearranged the code a bit, a different while loop threw the 150001 error.

Maybe it's a memory issue, I'm at a loss here.

I've uploaded the source here.
(3.0 beta 14, press o or p to see it work fine, shift-o or shift-p to see it crash)

Edit: I see, that's too bad. Well, go ahead and download it, I've removed the password.
#31
The objective: use the outline to create a mockup of a 2D Jump'n'Run game for a cellphone.
(A mockup is hand-made to look like a screenshot.)

The limits: keep the size at the given 128x128, don't use more than 32 colors.

EITHER: stick precisely to the outline
OR: use tiles, but stick to the general shape


EDIT:
inspiration:

And a first entry, great!
Keep 'em coming!
#32
When I rode home on my bike today it was raining, and suddenly I thought about coding a decent replacement for the snow/rain plugin. Well, at least for the rain part.

It still needs to be polished a bit, plus I have yet to come up with a user-friendly way to set up the 3D parts.

to-do list:
-support for other resolutions than 320
-ability to let things get wet
-user-friendly 3d system

done:
-wind
-hits ground differently depending on material

DOWNLOAD DEMO
#33
BERNARD'S ROOM



DOWNLOAD

This is another (not yet official) installment of the Maniac Mansion Mania series.

It's relatively short and features a totally non-proofread translation by yours truly and two or three inside jokes (one of them being the fact that the game takes place in the way overused Bernoulli house and stars used-to-death character Bernard).

Nevertheless I've put quite some effort into this game, so enjoy it!

(Btw, GetTextWidth doesn't work properly with translated strings but the effect actually looks pretty neat, so I kept it. You'll find out soon enough what I'm talking about. ;))
#34
I'm planning to try myself at a resource management / strategy game (think a not so complex Colonization).

Here's a first draft of some icons:


Are they instantly recognizable? Internationally?

Comments & suggestions/paintovers appreciated.
#35
I really liked the previous Jam's topic, plus there are quite interesting discussions going on in gen-gen right now, so I want to see a two-faced god, usable as a character in an adventure game.

No harsh restrictions, but try to keep the size below 150x150 and preferably don't use more than 32 colors.

Interpret the topic as you see fit, depict whatever god you like; you could even do two sprites showing the good and evil side seperately.

(The sprites will be judged only on technique and originality, so don't hesitate from submitting an OT christian god with red eyes and fangs ;))

EDIT: It doesn't have to be a human, not even human-shaped. It could be a big eye, or a hand sticking out of a cloud; just use your imagination.
#36
The problem is solved already, but I've encountered a strange behavior while dealing with it and I'm curious what could be the reason for this:

I've added the translated words and stuff to a translation source file.
The GUI and shortcut keys are translated like this:
Code: ags
...
JjNn
YyNn
a_button_give 5 802 803 Dd
0 1 2 Gg
a_button_pick_up 2 800 801 Ee
1 7 8 Pp
...

(No "a_button_x" stuff in the translation is the correct way to do it, btw.)
When I tested the translation, neither pressing "y" worked nor were the GUI buttons display correctly.
I've contacted the game's author and he sent me his version of the translation. The above part of the txt-file looked *exactly* the same, I've double-checked this, and with his version, the GUI buttons DID work, but pressing "y" still didn't. (I've added Display commands to debug and the GUI stuff was translated but "JjNn" wasn't.)

In a desperate attempt to solve this, I recreated the translation source and pasted over the text. First everything before the above, then the above piece, then everything after it. So once again, I had two txt-files looking *exactly the same*.
I then created a compiled translation from the new source, and suddenly everything worked fine!

I don't get it. Any enlightenment is appreciated.
#37
This is for a small game I'm currently working on.

Something's gonna explode resulting in Ed, Bernard and Razor being catapulted in the air.

This is still very rough, but I wanna make sure that it "feels" right before I start coloring and fine-tuning.
What bothers me most is the position of the arms. Currently only the right arm of each person is visible, I'm not sure if this is correct, though.



Comments, suggestions?
(zipped psd file)
#38
The Rules (tm)
* This is a quiz about adventure gaming trivia. Each installment has about a dozen questions with a common theme, about well-known adventure games, either classics or from the more famous "indie" games. Suggested themes include but are not limited to inventory items, music, easter eggs or forest creatures.
* Each question is worth two points if correct, one for a partial answer, and three if you have a better answer than the person who made up the question.
* This thread is for hints and feedback, as well as noting your participation. Please send answers by PM to prevent people from peeking. The quizmaster will post all answers when the quiz ends.
* As with most activities, the winner of this quiz will be the quizmaster of the next one. In case of a tie, the person who submitted earlier is considered the winner.
* I'm setting a deadline of a week, then give me a few days to look over all answers, and give the winner a few days to come up with something new. The result should be a biweekly quiz, or thereabouts.

This week's Quizzening: Monkey Island Special
Since probably almost everybody has played the first three games, there should be enough people able to enter this one. The second and third game both had a light mode, however, all questions apply to the normal modes.

If you haven't played all three, please tell me in your PM, I'll then try to adjust your score accordingly so you won't have a disadvantage.

-The Secret of Monkey Island-

1. Named after a type of noodle, they provide Guybrush with the ability to get started with his Quest. Who?
2. One person actually uses the force in a well-known way. Who?
3. X marks the spot on the bottom of a chasm. What does the X consist of?
4. In the church, LeChuck and his bride are standing in front of the altar, when suddenly Elaine appears. Who's wearing the wedding dress?

-LeChuck's Revenge-

5. How many pieces of eight is the map piece in the store?
6. What does Guybrush sell to the store owner in order to get it?
7. In the beginning, Guybrush has to steal something. He makes up for it with a piece from a display model. What did he steal?
8. At one time, Guybrush has to pay attention to the wind. What for?

-The Curse of Monkey Island-

9. Who was Murray before he lost his (skeleton) body?
10. Why couldn't Guybrush simply pull the cursed diamond ring back off Elaine's finger to try to relieve her from the curse?
11. Next to which building was the pepper plant?
12. Who was the only non-animatronic person in the ride at the end?
#39
I've spent the whole night on this one (it's 7:22 AM here now), I really hope this'll pay off.



Pixeling the roof was hell, I don't have the nerve to add lighting right now...but I will.
Basically, I need advice on the choice of colors, the sidewalk and the (missing) background. And the clouds.
Ignore the civic, it's just in there to connect the different elements proportion-wise. Maybe I'll trace it, maybe I'll do a different car from scratch, I haven't decided on that yet.

There aren't any windows yet. But if I added them, I'd have to seriously redraw the interior. :P As the game is set in the not so distant future, maybe those walls are made of some special glass and let sunlight pass through them? Who knows :=
#40
Although I discovered AGS in early 2005, I still haven't manage to publish one single game (except a very short Maniac Mansion Mania episode).

To be able to concentrate on puzzles and story more, I've chosen to use an even more minimalistic style (old bgs).



I know, the walls are quite empty yet, anything besides that?
And in case you wonder, the transparent thingie is a flatscreen TV suspended on the opposite wall.
SMF spam blocked by CleanTalk