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

#1
I made this for background animation in my own game, thought I'd package it up for release... hope it's useful for someone. Essentially it's a video playing plugin, with an internal ogg/theora decoder. Theora is a free video codec targetted to compete with well known MPEG4 codecs (xvid, divx etc). Quality isn't quite there yet but close enough, and the encoder is still being improved.

Generally be careful with it because as I said, it's for my own use and may not work in unusual situations. For a start it only supports videos encoded in YUV420 which happens to be most of them. Also seeking doesn't align to keyframes so there will be momentary tearing when seeking to a non keyframe, tell me if you need that fixed. Doesn't interpolate chroma though I suppose it should. If anyone actually uses it they can tell me what they want adjusted for their purposes.

plugin download / demonstration download (try it in d3d mode to see the rotating etc if you care)

Interface

Code: ags
/* values specifying the "layer" of the scene to draw the video over */
enum RenderStage {
    RsBackground,
    RsScene,
    RsUI,
    RsOverlay
};

enum RelativeTo {
    RtRoom,
    RtScreen,
    RtScreenPixels
}

/* Each Theora instance represents an open video file. */
struct Theora {
    // opening
    static Theora* open(string name);
    
    // positioning
    void NextFrame();       // move to next frame
    void Sync(float time);  // advance 0 or more frames to sync with time
    void Seek(float time);  // attempt to seek to a position
    
    // status
    readonly bool broken;   // the video is bad and can no longer render properly
    readonly bool ended;    // end of video was hit, no more new frames will appear unless looped
    readonly float time;    // current time of video (may be inaccurate)
    readonly float fps;     // fps of encoded video, you don't have to stick to it if you don't want to
    readonly int width;
    readonly int height;
    bool loop;              // enable/disable automatic looping

    // rendering
    void Draw(RenderStage stage, int left, int top, RelativeTo);
    void DrawEx(RenderStage stage, float cx, float cy, float xscale, float yscale, float rotation, RelativeTo); // scale/rotation can only be used if d3d renderer is being used!
}


Advantages of this over regular video playing are
. doesn't require user to have installed any codecs, while providing better compression than available by default
. completely free format for free and commercial use
. draw videos within your scene and onto sprites for special effects
. (hopefully) no black frames or other signs of switching between game and video

Disadvantages
. is a plugin, therefore only works on windows engine right now
. decoding is fairly slow, YUV->RGB conversion needs to be done in software which is an additional overhead, not sure what the minimum specs for a full screen 640x480 30fps video would be, but somewhat higher than the regular video player. However, I did have someone test the demo on an ASUS EEE PC with 900mhz processor and it seemed fine.
. does not do audio. AGS already does audio, if you want you can sync up a sound/music file with the video with script. The main purpose of the plugin is background animation which does not require audio.
. requires some scripting to get it going, videos don't play on their own (although I could make them if people really want)
. only supports 32 bit mode at present
. software mode doesn't scale videos, therefore playing your game at the wrong resolution (scale filters are fine) will look bad. I don't think AGS should have this option on the setup though, personally.
. one unpredictable lockup issue which occurs from time to time when exiting in d3d mode, which I will fix some time, but it is fairly rare for me.

Details

It's quite basic as it is, I only need it for background animations, but if anyone uses it and would like features go ahead and suggest them. Support for 16 bit mode and video file obfuscation might be worth doing.

Here's the room script from the demo game, as an example of how to play a video on the background (and how to scale and rotate one in D3D mode.

Code: ags
Theora* video;
float rot = 0.0;

function repeatedly_execute_always() {
    if(video) {
      video.DrawEx(DsBackground, 160.0, 120.0, 0.5, 0.5, 0.0, RtScreen);
      if(System.HardwareAcceleration) video.DrawEx(DsScene, 260.0, 120.0, 0.25, 0.25, rot, RtScreen);
      video.NextFrame();
      rot += 0.2;
    }
}

function room_Load() {
  video = Theora.Open("theora.ogg");
  video.loop = true;  
  SetGameSpeed(24); // you don't need to use the same fps as the video like this, but it's easiest this way
}


I should also say, if you have a video open and go to another room, that video is still open! When you no longer need a video set the pointer to null. You can do this on exit, and load it on enter if you want. Just in case someone loads a video background in every room and wonders why it's taking 100s of MB of RAM.
#2
General Discussion / OROW 2008
Fri 20/06/2008 02:37:35
Here's a last chance warning: this year's OROW starts tomorrow. Check the activities forum thread if you are interested in taking part. Otherwise sorry for the spam!
#3
OROW V, 2008

Time is up. Hooray for all those that entered. We have 12 games this time, and they're all in the zip below.
download: orow5.zip (79.6MB)
Voting is now over, here are the results:

The audio winner is: Man Boy vs Doctor Sock by Ben304
Best game design goes to: How Many by AJA
The visual arts award goes to: Seed by LimpingFish
The highest writing score went to How Many by AJA

Aaand the overall winner for this OROW is... How Many, AJA's second win in a row. First time that has happened.

A special commendation to MashPotato's Beauties and Beasts which scored high in every category, winning none.

if you want to see your scores in detail: http://www.adventuregamestudio.co.uk/aga/orowv/res.txt

The authors of the games were:
Baltazar the Familiar - King Wiking
Beauties and Beasts - MashPotato
Chatroom - JBurger
Cheerful Science - Akatosh
How Many - AJA
Man Boy vs Doctor Sock - Ben304
One Week, One Room - Jon
ONNA - Dualnames
Seed - LimpingFish
Think Outside the Boxland - TheOrator
Unfinished Business - Ishmael
Wisp - SimB
#4
I saw some interest in using the SIXAXIS controller in AGS games, in the "AGS to move to PS3" thread. I decided that those of us stuck with the old version on Windows might like to try stuff like motion sensing controls without having to update to the PS3 platform, so here is this rough plugin which allows you to use the Wii remote in your AGS games. Currently motion sensing, IR sensing, buttons and rumble are supported.

Requirements: Nintendo Wii remote(s) connected to your PC (easily done via most bluetooth adapters), a relatively modern version of AGS.

http://www.caverider.com/temp/ags_wiimote.zip
#5
General Discussion / OROW V
Mon 11/12/2006 12:43:06
It feels about time for the next One Room One Week competition. I'm posting to ask firstly about interest, and secondly about when would be the best time to hold it. The Christmas holidays would be fine for me, but I know a lot of people have things to do over them, how many of you would be interested and available?
#6
General Discussion / #AGS (A Temporary Sticky)
Thu 22/06/2006 13:31:16
It's come to #AGSers' attention that, although there's a page about it on the main AGS site, a lot of forumites don't even know the IRC channel exists. If Radiant didn't, then anyone might not! So I'm putting this sticky here for a few days. Maybe we'll get a few newcomers.

#AGS was started over 5 years ago on Quakenet, it's been in constant use since, and averages about 20-30 people online (though half of those will be idle). It is now on its own server (irc.adventuregamestudio.co.uk) and has a bot called Roger. It's a general discussion channel, which is why I put this thread in GenGen, but there's also a tech help channel, #agstech, which unfortunately doesn't have many people to help, currently, perhaps some tech forum people would like to come there and help me help people.

AGS IRC Wiki page

Server: irc.adventuregamestudio.co.uk
Channel: #ags
Some recent stats: http://www.americangirlscouts.org/pisg

If you'd like to come, there's a guide on the site.
#7
Hello everyone, I have lots of photos and other nice things for you... you see over the new year a bunch of us stayed at AGA's house, we called this Wintermeet!

Perhaps I should explain how it all happened first, for those that haven't heard, I believe it went something like this.

Hajo sadly had to miss Mittens, and to partially make up for it he decided to come to Wales, he asked AGA if he could stay with him, and me if I'd come and hang out with them and play CS and such, and of course we said yes.Ã,  When our CS playing friends (Esseb, Helm, DarkStalkey and Custard) found out about this they wanted to come too, we were now expecting a weekend of mainly sitting indoors shooting each other.
We did mention it to other people though, and before we knew it twice as many people wanted to come. AGA's house is big, but it isn't big enough to fit many more people than that in it (you'll see at Brittens). So unfortunately to prevent more people asking to come, and having to turn them away... it was decided we wouldn't post publically about it until after it happened.. it's been over a month now though, so I asked the others if they were ok with me posting their photos and here we are.

Welcome to Wintermeet!

The attendees were AGA, Andail, Becky, Chrille, CJ, custard, Adam, Dominika, Esseb, Fuzzpilz, Goldmund, Grundislav, Hajo, Helm, scotch


Dominika, Goldmund, Helm, AGA.


AGA, Fuzzpilz, Custard, Hajo, Adam, Becky.


We went on an expedition up the mountain!


At the top the weather started to get colder and it began to snow.Ã,  For a time we thought we'd lost Chrille.


We found this fellow next to his downed space-pod, and adopted him, he is called Spooblehat.


The more exciting people decided they weren't going to stay home and make games on new years eve, so they went to a club.


Smoking made Goldmund cool.


As you would expect, CJ is good at Dance Dance Revolution.

We started a game, which will probably never get finished ;) We played Wetrix and CS and Lego Star Wars, we watched stuff from Esseb's Asian movie collection, and Myth Busters, we saw the beta of BJ5, and more stuff from Donna (I need to play that game), we drank glue wine and Tesco bitter, you know, we did so many things, I can't post all the photos, so take a look at them for yourselves, I'll add some more if I get them.

Here are some moving pictures! Not many, Grund's camera ran out of batteries.
Grund filmed this excellent avant garde piece: http://www.grundislavgames.com/wintermeet/meltthelimit.wmv
and starred alongside CJ in this excellent sit com: http://www.grundislavgames.com/wintermeet/misunderstandings.wmv

As usual for AGS meetings now, we played 1000 Blank White Cards, thanks to Esseb for scanning them! http://americangirlscouts.org/wintermeet/1kbwc/

It was a really great few days, and it was cool to meet the people I'd not met before, like Fuzz and Esseb and Becky.
Wintermeet people, fill them in on the stuff I forgot!
#8
I post this here for people who don't habitually read the competitions forum, yes it isn't normal to announce a competition outside the competitions forum, but this one only comes by twice a year or so, so I don't want people missing it.  Plus OROW is suitable for all, not just people with art or music skills.  It is a general game making competition that won't take too much time out of your life.

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=24676

This post will be deleted in two or three days.
#9
The third official OROW competition commences now!

Here are the rules:
Ã,  You must make an AGS game within the next week.
Ã,  You should work alone, but may find one person to help you if you need to.

There is no room restriction this time, might seem funny for a "One Room" competition, but it always ends in discussions about what a room is and I want to see if people have the restraint not to aim too high.Ã,  So you are allowed to do what you like but be aware of what people have managed to make in past OROW competitions.Ã,  It is much better to aim low and get something done than to aim for what you think is the most you can do in a week (you probably won't be able to do half of what you expect).Ã,  Everyone is encouraged to enter, I'll will try to.

Have fun!


Results!


  • The graphics award goes to Blackmail in Brooklyn! (4.3)
  • The award for writing goes to Science! (4.0)
  • The the best scripted game was voted to be Tomb of the Moon! (4.1)
  • The best puzzles award goes to Tomb of the Moon! (3.7)
  • Best music is awarded to Blackmail in Brooklyn! (3.5)

The overall winner by public vote is...
Tomb of the Moon![/color]
Well done Ishmael and Pablo!

Game Titles with their Authors:

24 Hours - AJA
Bad Luck - Mugs
Blackmail in Brooklyn - ProgZMax (BG art by scotch)
Heart of Abraxas - Esper
Illusions 1 - Mwahahaha
Locked - Skyfire 1
Science! - Fuzzpilz
Spacemaze - BOYD1981
Tomb of the Moon - Ishmael, Pablo

Well done everyone else, there were some very close results.

STATUS - Games have now been released, voted on, and the results published, you can still download them below.

1 x 29.8mb archive for the broadbanders
7 x 4mb archives for the dialuppers
#10


Tomorrow it will be 6 months since the last OROW competition, and 9 months since the first, so I am posting to gauge interest in having the next one some time soon.

For people that aren't aware of the competition I'll explain how it works.Ã,  You have one week to make an AGS game that is set in one location, you must work alone or in a pair.Ã,  There are no other restrictions because the goal of this competition has always been to get people making and finishing games.Ã,  In contrast to other competitions that have longer time limits, loftier gameplay goals and large teams, OROW gets a lot of entries; there have been about 23 so far, across the two competitions.
It seems that this sort of small game also encourages people to experiment, a lot of the entries are not your typical AGS games.Ã,  Most participants seemed to find the competition a good experience, and everyone is encouraged to enter.

If you are interested in taking part, post here to let me know, and also if you have any suggestions for changes to the rules.

#11
Three months ago we held a quite successful "one room game" competition.  Enough people seem to be interested now to start the second.  Some people who may want to take part are away for Brittens for the next week, so the competition will start once Brittens is over, on the 8th of July.

Deadline for game entries: Sat 16 Jul 2005, 00:00 GMT.
Extra rules:
There are no additional rules, I was just playing with you!

Rules are as follows:

Entries must -
   have just one playable room/location.
   be adventure games.

They may -
   use content from any source, including pre-made.
   have cut scenes, menus or limited controlled sequences outside the main room.

You should work alone, but if you need help with an area of the game (art, music...) you can find one other person to work with.

Some examples of "one room games" that would be allowed are 6 Day Assassin and  Little Jonny Evil.

Entries will be submitted anonymously. When a game is completed, its creator must contact me by PM with a download link (or to organise some other way of my receiving the game files). I will then temporarily host the game on my own site, and announce the game's release on the forums. This is to guarantee each game is voted on due to its own merit, not simply because of the names attached. Because of this, game entries can not include the game creator's name or company name anywhere. All names will be disclosed once voting has ended.

The winner will be decided by public vote once the competition ends. Voters will give each game a score out of 5. Voters will be expected to have played, and to vote on, at least half of all games entered. However, of course, playing them all is preferable.

The competition will start on Friday the 8th of July, to give people a chance to read this announcement. You should not start making your game until then. Even if you think you have no chance of winning, you're encouraged to enter - it's as much a forum activity as a contest.

Absolutely no information about your game should be shared with anyone until the competition and voting has ended. Please reply to this post if you intend to take part, but don't give any idea of what your game will be about.


ADDITIONAL CLARIFICATION:

By a room, we do not necessarily mean one crm file. If you want to use other rooms for effects such as time passing, changes in the style of the room, minigames such as the sniper mode in 6DA etc, that's fine but the bulk of the game should be centered around one location.

Check the previous OROW contest entries to get an idea of what you can do in a week. Just be creative, think small, and confine it to one physical, walkable-aroundable room/location.

ENTRIES AVAILABLE HERE.

WINNERS ANNOUNCED HERE.
#12
So everyone knows, yesterday morning we decided to move the #ags channel away from Quakenet, which has always been a bit unstable and slow due to its size, to the smaller and more development focussed Freenode network.Ã,  Then this morning we decided to move it again because we are addicted to moving or something.Ã,  You should now connect to irc.adventuregamestudio.co.uk.Ã,  Sorry for the inconvenience.

Those of you who have never been to #ags are welcome to come by, the channel has existed for a few years now and is quite active, it's a great place to get to know other AGS people better.Ã,  Just get yourself an IRC client, such as mIRC, connect to irc.adventuregamestudio.co.uk, and "/join #ags".
#13
I am not sure if it'll ever be useful to anyone, but I made this this evening, and here it is.

If you've played old Sierra games, or some modern low res games you've seen it.  This gives you the 160x200 background/character effect, keeping 320x200 guis and text.
"Why can't I just scale my graphics to do this" you might ask, well there are a few problems you might not thing of right away, one major one that ruins the effect is the way the character can seem to move half a pixel, which looks very wrong.  This forces all pixels into the right grid.

Here is a shot of Ghormak and Helm's 'Gladiator Quest' which used the plugin, instead of PC EGA this was emulating the C64 multicolour mode:


It just does that graphics resolution, not other AGI game things, such as parsers or keyboard control, if you want any of these you should script them yourself .

Also, in the event that you do use this you'll probably get some bugs, I promise to fix them if I can.

Edit: uploaded a working screenshot.
#14
By the power vested in me by the state of OTG and ._. I now pronounce Artitude alive!Ã,  Let's hope we get some entries this time around.

The theme unanimously chosen by the secret elite is AGSer Portraiture.

Draw your fellow AGS community members, any resolution, any style, hand drawn, pixelled, 3d, finger painted, it doesn't matter.Ã,  I won't restrict it to faces, draw them doing something amusing if you like.Ã,  Practice your art skills or make everyone laugh.

This Artitude will end in one week, on the 4th of September.

Sex and violence encouraged restricted, we would love not want to see each other in such situations. Go art!
#15
I don't want to have to think about it so I'll take an idea from the suggestion thread.  Tell me if it's been done already.

Evil Geniuses always have a lair, usually in a volcano, underground, beneath the arctic ice or in space and often with pits of sharks, trap doors and white cats.

So draw an arch villain's lair background, you can do it in any style you like.

I think I'll go for a slightly higher resolution this time, just for a change.
Resolution 640x480, colour depth 32 bit, it can be a scrolling background if you like.

And you know.. it's a background art competition so do try and come up with something that could actually be used as a bg in a game.  If you want to draw random art then we could start up Artitude again perhaps.  I would like that.
#16
I remember I asked for seperate x and y walk speeds once, to make things look more realistic on rooms that aren't viewed directly from above, that's been implemented now and it's great. So to compliment it I thought I'd suggest something related that bugs me a bit (it's in Broken Sword, and George's walking would look much worse without it).
Lots of you will get this straight away but here are some diagrams for those that don't.
On overhead views the angles for walk directions would be like AGS does it now. (Just using 4 directions to keep things easy to see).Ã,  That is 90 degrees for each direction deciding on which direction loop it uses.Ã,  Which works in this situation.


But most games use perspective views in which this just looks wrong.Ã,  The direction the character is moving in should be relative to the floor, not to how he is moving across screen coords, obviously he's not really in a 3d world so he's just moving through screen coords but it needent look that way.Ã,  The angles that each direction should use would be scaled, depending on the angle the floor is at to the camera (probably can't be precise in hand drawn art but you can get it looking about right), something like this would work for this room:

it means that if he was walking at 20 degrees (anticlockwise from right) in screen coordinates he would have the up view, which would look best for the room, because he would seem to be moving in that direction across the floor.

For people who don't want to use it it could just be set to the normal angles by default so they don't have to mess with them and it adds no extra hassle.. but it could be set on a room by room basis, perhaps in script, for people like me who get bothered by things like this.

It is a basic feature of many adventure games though.Ã,  I even think it's like this in early nineties LEC/Sierra games.Ã,  But I'm not certain.
#17
One of the most highly praised games previewed at Mittens 2003 is now available for the public's adoration, and before 2004 too (GMT)!

Following the adventures of Jon Stickman in his quest for the love of a girl you will experience many exciting locations, a cast of interesting characters all rendered in gorgeous stickman style!  Discover the corruption in our healthcare services, the lengths one man can go for his love and the number of animations AGA can force me to do some time in the future when the game is out, for now try this demo.

Due to wanting the demo out in 2003 and it being 2004 in 5 mins this hasn't been tested, have fun!




It's 1.12MB
#18
Advanced Technical Forum / Square Root
Wed 22/10/2003 22:05:58
Edit by strazer:

AGS 2.7 Beta 8 introduced the Maths.Sqrt function.




In case anyone needs to find the square root of something or the distance between two points (how far apart two characters are, for instance) I thought I'd post these.

I needed to find the square root of something for a gui, and since ags doesn't have a sqrt() function, and there isn't a plugin for it I had to write one, so with the help of Annie, and Newton here it is
(along with abs() sqr() and point_distance() which I just find save time)


function abs(int number) { if(number<0) number=number*(-1); return number;}

function sqr(int number) {
  return (number*number);
  }

function sqrt(int number) {
  number=abs(number);
  if(number==0)number=1;
  int guess=Random(number)+1;
  int previousguess;
  int result= -1;
  int maxiterations=10;
  while(result!=previousguess && maxiterations>0) {
    result = (number/guess+guess)/2;
    previousguess=guess;
    guess=result;
    maxiterations--;
    }
return result;
    }


function point_distance(int x1,int y1,int x2,int y2) {
  return sqrt((sqr(x1-x2)+sqr(y1-y2)));
  }


I am terrible at maths.. so they may well be scripted extremely badly but they seem to work in my game.
SMF spam blocked by CleanTalk