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

#1
I've recently been thinking again about how much I love point and click adventures and how much I want to do one someday.
The biggest problem for me have always been animations. They're tedious to do and if you're not into pixel animations like me doing them the traditional way takes a lot of patience and practice. I have neither of which so I've always been looking for ways to cheat ;)
Modular animations are such a way. Why draw a leg 15 time when you can draw it once and translate it into the right position? Have a look at Odin's Sphere to see this pulled of perfectly klick! The problem with these animations is that you can't do foreshortening so  you're perfectly fine as long as you do a side view but when it comes to the front and back views it will look weird.
Still the advantadges are so tempting: Keyframing, Unlimted frames, Very detailed sprites and most importantly: You can reuse animations. So down there you can see the same animations with three different characters applied - all made from a template. Took me each about 45min for the template and another 5 to tweak the animation to the character. The animation itself took about 90mins.

You probably also see the disadvantages - yet tell me: Would you play a game with such animations (Side view will look much better!) or is it rather anoying?
#2
Well this is more of a math question than a technical one. I still think it fits here best.

Basically I want to have a line which has a fixed origin and length to point towards the mouse pointer.
I already put everything together to the point that i only need to supply an angle for the line-pointing-thingy.

I found this formula which I used somewhere else which i think can be resolved to output the angle
Code: ags

mouse.x = originx + 'r'  * cos(angle)

will resolve to

cos(angle) = (mouse.x-originx) /r

//r is is the distance from he origin to the mousetip - calculated with the good old pythagoras and thats also where my math skills end



So my simple, yet probably naive, question is
How do I get the angle out of the the Cosinus

DAMN YOU TRIGONOMETRY!!!

#3
I opened a thread yesterday about getting null pointer errors with falsely exported struct variables.

I went on and changed it and it worked fine - in one script. I did exactly the same thing in another and get a script link error
I have three modules with the following hierachy

- Rectangle.asc/h
-Rectangle_Operation.asc/h
-GlobalScript.asc/h

the headers contain struct declarations and struct variable imports

Well lets take a look at it
Rectangle.ash
Code: ags

struct Rects
{
...
};

import Rects Rect;

Rectangle.asc
Code: ags

Rects Rect;

...lots of fancy stuff...

(end of script)
export Rect;


This works perfect so far (thanks again khris!)

Now I did this in the rectangle_operations script as well
Rectangle_operations.ash
Code: ags

struct Rectangles
{
...
};

import Rectangles Rectangle;

Rectangle_operations.asc
Code: ags

Rectangles Rectangle;

...lots of fancy stuff...

(end of script)
export Rectangle;


As you see this is done in exactly the same manner as the first one, however when
GlobalScript.asc calls any memeber function of Rectangle ags throws a script link failed error at me.

It seems completely random as i can access members of Rect without a problem. Please Help!
#4
Hey guys, this one is rather hard to explain.
I have two module scripts

In the first module script have a private struct that manages all the operations called _rectangle
I also have the public (imported) struct called Rect which has some functions and properties used to read and write the significant variables to the local structs

For example i can call
Code: ags

Rect.GetX(ID) 

from the Global script to get the x-coordinates of the given id

The same call will throw a null pointer error if i try to access it via my second module script.
The second module script has a public struct ("Rectangle") which contains the function "Move"
When called in the global script via
Code: ags

Rectangle.Move(ID, ..other parameters)

...it internally trys to get the coordintes via the Rect.GetX(ID) function which throws the exception
Even though the pointers seem okay from the globalscript's point of view.

Passing through the coordinates via parameters won't help because I also need to write data with a function in the same method, which also will gives a null pointer

So accessing any data structures of Rect via a member of the Rectangle struct wont work - why?
#5
Critics' Lounge / How to color this?
Tue 09/08/2011 12:07:53
I got sick of learning today and made this concept art for concurrence. Normally I already start with my color palette but this time I decided to make a volume study first like many people do it (saw it at theos work). My problem is now. I don't know how I should go about colouring this in. I heard most people use HSL adjustmendt layers but that doesn't seem to work that well for me.
Is there soem sort of trick involved?
Maybe someone has some advice



Uploaded with ImageShack.us
#6
Hey there,
I'm still working on a tile engine, while the drawing works pretty good so far its time to add some game logic in there.
I'm trying to retain as much of AGSs functionality as possible. As I coud easily code my own collision detection this would break for example the pathfinding algorithm.
So I wondered and this might be a stupid question:
Is it possible to use to RAWDraw function of AGS to dynamically draw a walkable area on screen? Or is there any other way to create a walkable are from script?

thanks in advance
#7
Ok guys, its one of these retarded questions again I just can't seem to figure out
I've got a script header with this struct:

Code: ags

struct Engine {
  bool ShowLoadingScreen;
  int LoadScreenGraphic;
  int LoadScreenColorBG;
  int LoadScreenColorHigh;
  int LoadScreenColorLow;
};
Engine UTE;
import Engine UTE;

When I run this, I get an error "Variable "UTE" is already defined"
if I leave out the import I can access the variable from local scripts also but value changes seem to stay local - so I can't pass a value on to a module script. So how can I make the struct to become global?

OFFTOPIC:

I dont want to open another topic on this as its probably rather simple.
Structs can contain functions right, so I can call them like this

MyStruct.Myfunction (parameters);

right?

So how do I declare them?
Probably I can just write
function xxx (parameter);
in the struct, but how do I declare the function in the main script??

Do I just write
Struct.function (parameter) {
 stuff
}

Or how would I pull it off?

#8
I was messing around with AGS a little and stepped over an Buffer Exceeded Error.
This is not due a missing closing bracket. Here's the line:
Code: ags

surface.DrawTriangle(vertex[polygon[PC].a].x * polygon[PC].a].z*100, vertex[polygon[PC].a].y * vertex[polygon[PC].a].z*100, vertex[polygon[PC].b].x * vertex[polygon[PC].b].z*100, vertex[polygon[PC].b].y * vertex[polygon[PC].b].z*100, vertex[polygon[PC].c].x * vertex[polygon[PC].c].z*100, vertex[polygon[PC].c].y * vertex[polygon[PC].c].z*100);

I think I remember there is a 500 chars per line limit in ags. If this is the case, Is there some kind of workaround?
#9
Hi Guys,

I'm currently writing a tile engine that imports TMX files. Parsing the file format and loading the maps already works quite well, but now I've run into a performance problem when loading the maps.

When parsing a TMX file I end up with a string like this for each layer

0,0,226,227,228,0,0,0,226,227,228.....
.
Im using this to load the values into a struct when loading the map:

Code: ags

// This subfunction returns the the single value of the csv
String DecodeCSV (String source)
{
  //Display ("Parsing %s", source);
  if (source.IndexOf(",") != -1) End = source.IndexOf(",");
  else {
    return "ERROR";
  }
  String Result = source.Substring(0, End);
  //Display ("Decode CSV: %s", Result);
  return Result;
}

 // Write Layers
  lStatus.Text = "Reading Data for Layers";
  Wait(1);
  String RAWLayerData[10];

  int CL;
  while (CL < Map[0].LayerCount) {
    RAWLayerData[CL] = ExtractTag (RAWLayer[CL], "<data encoding=\"csv\">","</data>");
    RAWLayerData[CL] = RAWLayerData[CL].Append(",");
    int t;
    String temp;
    while (DecodeCSV(RAWLayerData[CL]) != "ERROR") { //this is what takes most time
      temp = DecodeCSV(RAWLayerData[CL]);
      Map[CL+1].Tile[t] = temp.AsInt;
      RAWLayerData[CL] = RAWLayerData[CL].Substring(End+1, RAWLayerData[CL].Length);
      Map[CL+1].TileCount++;
      t++;
    }
    //Display ("%d Tiles Written for Layer %d", Map[CL+1].TileCount,  CL+1);
    CL++;
  }


I works pretty well for small maps but big maps like 150x150 tiles take almost 5 minutes to load.
I guess the way I'm decoding the csv values with the DecodeCSV string is overly complicated, but this is pretty new stuff for me so my question is: Is there any way do this more easily and faster.

Thanks in advance
-mode7
#10
Hey guys, this seems so simple and yet I couldn't find anything in the documentation about this

I'm trying to use the double quote character (") in a string. obviously ags displays an error message. Is there any way to specially encode this character kind of like you can do %% to do the "%" character?

String Version = ExtractTag(RawMap, "<version = "", """);
#11
About time that I post this here:

Concurrence

About the game
Concurrence is a so called cinematic platform game. Unlike other platform games you will know (like „Super Mario Bros.“ or „Sonic the Hedgehog“), this game focuses on realisitic movements, puzzles and a dense atmosphere. If you have played games like ‚Prince of Persia‘, ‚Another World‘ or ‚Flashback‘  you will know what awaits you. Many of parts of the game will require precise jumping and you might feel a little frustrated at the beginning. But don‘t despair,  study the movements described in this manual and keep on practicing and you will find that it isn‘t so hard after all (you also have unlimited continues). This version was done for the april 2011 Monthly Adventure Game Studio Competition (MAGS) and does not feature the full game. It‘s more of a demo. The finished version will follow sometime 2011.  ptp88 composed a great soundtrack for the game.
- Have fun playing



Story
My blood was beating against my skull as the blazing sunlight and the piercing screams of the bird-like creatures give me a rough awakening from a dreamless sleep. I was wearing an astronaut suite, but my helmet was missing. The steaming pile of metal right next to me indicates that its some kind of vehicle and that it probably brought me here. Where was I?....Who was I? Who sent me here and for what reasons?
As looked to the sky, shielding my eyes from the bright sunlight, I suddenly realized that these questions had to wait. I had to get leave this place. Now. Time was running out for me. As I know today: In more than one sense....

Screens






Updates

- Improved loading/saving system
- Now with manual!!!!!

MAGS
If you liked the game, vote for us at MAGS

Download
http://www.mediafire.com/?hfoli9x1w0jcizx

#12
Critics' Lounge / Consistency Issues [UPDATE]
Sat 16/04/2011 11:25:36
You probably know this: You doing some Backgrounds, thinking of nothing bad and then: "OMFG!!!!! This looks awesmoe" You're Background looks better then expected.
So where's the Problem you would think?
Well the problem is that the previous BGs looks like shit compard to the new one.
I got this problem here and since this is a project for MAGS I can't just go back and repaint them. But I also don't want to  scale down this BGs quality.

So any suggestions how to slightly alter the first BGs so there is still a consistent style in the game?
Is also like some comments about the color scheme.

This is the previous look:

And this the newer version:
#13
Hi Guys,
I'm trying to implent some kind of countdown in my game.
Therefore I calculate the time out of the game loops.

I set the game to 48 cycles/second. But my frames counter goes haywire. It jumps to 75fps when idle. Repeatedly setting it does not work. The problem is that my counter runs too fast even though I used GetGameSpeed.

Code: ags

time--;
hours = time/GetGameSpeed()/60/60;
minutes = time/GetGameSpeed()/60-(hours*60);
seconds = time/GetGameSpeed()-(minutes*60)-(hours*60*60);
lTime.Text= String.Format("Time: %d:%d:%d", hours, minutes, seconds);
}


#14
It sounds so trivial but somwhow i cant really figure it out.

I have some lightning in my backgrounds. It appears, animates. disappears and waits for a certain amount of time before it starts anew. While doing that I want the player to still be able to move around (all the time) so that if hes on a certain hostspot and lightning is visible i can trigger something.
It seems impossible or at least extremely complicated to do. Unless I'm missing somethin. do I?
#15
I'm trying to display an enum at a label. But i can only do so with the integer values.
Is there a possibility to show the enum text instead of the int value?
lstate.Text = String.Format("State: %d",CurrentState); //this i have now

lstate.Text = String.Format("State: %s",CurrentState); //this won't work
#16
I think I can handle AGS coding already pretty well. But sometimes I miss the understanding for basic concept.
Especially these greenish varibvalbe Types like *DynamicSprite *Character *ViewFrame...... I don't even know what they are called. Normally I get along with them pretty well, but I don't really understand them. They seem to have a bunch of variables stored in there like a struct but I can never quite figure out how they work.
Maybe someone has a link explaining.

Well I have a concrete problem relating to this too:
Take this for example:
Code: ags

//Abbreviated code:
DynamicSprite *Dest;
function DrawParticles(int SystemID){
Dest = DynamicSprite.Create(800, 600, true);
DrawAlpha(Dest.Graphic, particle[i].sprite, FloatToInt(particle[i].xpos, eRoundNearest), FloatToInt(particle[i].ypos, eRoundNearest), 0);

Ok here's what i wanna do: "Dest" is pointing to the dynamic sprite. As I'd like the function to manage several dynamic sprites. But "Dest" is only pointing to one dynamic sprite. How to genrealize this? If this was an Array, I'd just do this:
Code: ags

DrawAlpha(dynamicsprite[SystemID].Graphic,....
But since I don't know anything about these kind of variables I dont know how to pull it off.
#17
Hey Guys!
I have this code I want to call from a module script:
Ultimately I want to have a bool that checks for a hotspot and returns true or false to avoid redundant and messy code in my room script
Code: ags
if (Hotspot.GetAtScreenXY(player.x-GetViewportX(), player.y-GetViewportY()) == hHotspot0)


When I compile I get an undefined symbol error. This is even what I expected cause I guess hotspots aren't global. So is there another way to check this?
#18
Here's an interesting interview with Jonathan Blow (Braid) about his new project The Witness.
http://www.pcgamer.com/2011/02/15/jonathan-blow-interview-social-game-designers-goal-is-to-degrade-the-players-quality-of-life/
Overall I feel he's quite arrogant and I really doubt if the game really will be the holy grail of adventure gaming (especially as he mentions Myst as main inspiration) but he's got a point when he says that adventure games haven't changed much since the nineties. Of course the old prinicple still works pretty well but pretty much every other game genre has evolved. Why not adventure games?
I'm starting this thread because I've been thinking about this alot. I'm planning to do some things very different for Dacey II. Like introducing gameplay elements from other genres - but still making a pure adventure and not some watered down genre mix.

Do you think classic point and click gameplay is outdated? Or are there at least elements in these games that should be modernized?
#19
Hey guys, today a strange thing happened to me:
I always thought I was pretty untalented when it came to painting. So I always made my BGs using some workaround tactics. Actually I hadn't tried for a long time. I'm currently doing some work on Dacey II while avoiding to work on my thesis. I was prepared to do the BGs in the same way as I did them for the first part. But lately I've read some tutorials and looked at some good background art, namely Ben's and especially Theo's (whose ressources taught me a lot). Then I just stood up this morning and did this BG - no sketches, no second tries - i just did it. I think for my own standards this looks pretty amazing. I've never painted much with my wacom before, but now that I was doing this, it felt like the most normal thing to do.

Well here's the background (Warning it's pretty big, like 2 mb):
Dacey II is gonna be a explorative open-world kind of game and it will be platform controlled just in case you wonder. Also ignore the background for now - as there are several parallax layers to be placed beneath it.


Uploaded with ImageShack.us
Acutally I don't even know if this is going to be in the game - as I just started this as a test.
Anyway special thanks go to Theo and Ben for sharing their knowledge.
I know that there a some parts which still are sub-perfect so I'd also apprechiate some critics.

Now I have another problem!

Now that I now that the game could look like this I can NEVER go back to the old background style - because I couldn't live with it anymore - it was okay as long as it was the best I could do..
This on the other hand means that the game will take MUCH more time to make which, realistically speaking, will make its release more unlikely. But on the other hand I REALLY want to make this game as the concept is really cool I think.

This is really a dilemma!

#20
Hey everybody. Finally got some time to do some coding today. As I'm doing a simple script which gets the keyboard input. It's inside a module and according to keyboard input it sets a enum. My problem is, that the values do work inside the module they get set in but if I want to use the values inside my platformer script/module they don't seem to get updated. I don't get an arror but the keys don't respond either.

Here's the header of the keyboard script:

Code: ags

enum Directions {
  Up,
  Down,
  Left, 
  Right, 
  None
};

enum Actions {
  Jump, 
  Action,
  Run, 
  NoAction
};

Directions CurrentDirection;
Actions CurrentAction;


so am I missing something here? Do I need to import or update the values somehow. Because I don't get an error
SMF spam blocked by CleanTalk