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

#241
An even simpler way: For each 5x5 grid point and each walkable area, only remember _whether_ that area has at least one pixel within x + 3, y + 3 around the grid point. This information is fairly easy to keep up-to-date, even when areas are changed at runtime. And it can be stored compactly.

When Character.PlaceOnWalkableArea() is called, find the point on the 5x5 grid that is nearest to the character and from there, do a breadth-first search for the first grid point that has an active area nearby, using the precompiled information. Then from that grid point, do a pixelwise breadth-first search to find the specific nearby pixel that belongs to that area. Move the character to that pixel.
#242
Quote from: Crimson Wizard on Wed 26/02/2020 16:01:14
Character.PlaceOnWalkableArea() [...] checks only each 4th or 5th pixel on the mask, and if your area is thinner, then it may miss it.

Nowadays, memory is essentially unlimited. So one way of fixing that would be to precompile for each point of the 5x5 grid and each walkable area where the nearest area point is, but only if this point is within +3 pixels in x or y direction. This would only need to run in the Editor when the area has changed and is saved and only on the grid points that are affected. If packed optimally, this would need 1 byte per grid point per active area (since two values from -3 to +3 fit into 1 byte).

At runtime, the algorithm for Character.PlaceOnWalkableArea() could work exactly as before,  but on each point of the 5x5 grid it checks whether an active area is near (using the precompiled list) instead whether an active area is right on the grid point. This can never garner a worse result than only checking the exact point of the 5x5 grid. Specifically, when a grid point is right on an active area, the new algo will give exactly the same result as the old algo.

For each point of the grid, there are at most n checks to find the nearest active area using the precompiled list, where n is the number of active areas of the room, so runtime wise this calculation isn't too bad.

There are still some snags and details to iron out  in order to make this work in practice, but the gist of the algo should work.
#243
The Rumpus Room / Re: Exciting exotic animals
Tue 25/02/2020 23:19:31
For Southern Germany, I can add Wolpertingers. These creatures are sure to exist although nobody has managed to film one live yet. On the other hand, lots of stuffed exhibits prove the case, as well as picture postcards sold in souvenir shops.

Here's an example:
#244
Pardon a newcomer question, but: The concept of a “Mittens” is new to me (except as a synonym for boxing gloves). Just what are you planning to do for a weekend? week? fortnight?  Is there a sort of Agenda, a common project, some planned outcome? Can you point me to summaries/mementos/photo documentation of a former Mittens so that I can get an impression of what it actually is?
#245
Quote from: ManicMatt on Sat 22/02/2020 23:54:31
I knew I wouldn't get nominated for anything, and not because my game might be inferior, but because it's not been played by that many people!

Quote from: Snarky on Sun 23/02/2020 16:14:11
Yeah, that's always going to be a problem

Let's try and come up with ideas to make the nomination process itself less onerous for the participants.

  • Good games getting “buried” under a glut and not being played,
  • games getting a head start purely by chance just because they happen to have been put into the limelight when others might equally well have been, or just because they happen to have been published near the end of the year
  • an overflowing FYC thread that is in itself a big burden to work through,
  • well-meaning and committed regulars striking sail and not nominating at all,
  • lots of voters for just one game each
these are all symptoms of the fact that by now, more AGS games are produced within a year than can be reasonably evaluated within a month or so.

@cat has kindly put my own idea for that its own thread (see preceding link). I don't want to claim that this is the best possible way to go: It was meant as a basis for discussion in order to come up with better ideas.

But we really ought to do something about this. It is bound to become worse year by year. What is barely tenable now will become quite untenable very shortly.

(I suggest discussing this there (see preceding link) rather than here to keep this thread tidy.)
#246
Beginners' Technical Questions / Re: Room size
Thu 20/02/2020 13:15:54
Quote from: eri0o on Thu 20/02/2020 12:00:24
Depending on what you want to accomplish, you can solve by simply using:
Code: ags
function late_repeatedly_execute_always(){ 
  Game.Camera.SetAt(player.x, player.y);
}


Only, of course, then the camera movement is just as jerky as before because it mimics the jerky player movement exactly. So you'd rather need some logic such as "The ideal camera position is the player position. If that is farther away from the actual camera position than 3 pixels, then set the camera position to the actual position minus or plus 3 pixels, as the case may be. Otherwise, set the camera position to the ideal position." That's the gist of what I coded in Mamma Mia.
#247
Quote from: cat on Wed 19/02/2020 20:37:02
Now it worked. I noticed a few other improvements compared to the old version as well.

Yes, most noteworthy: I mitigated a pixelhunt.
Spoiler

There used to be just one screw that Jake can interact with. The others were visible on the screen but simply part of the surrounding fence. So if the player happened to move the wrench over those screws first, they got the feedback, "Oh, I see, the screws aren't really there, I must look for something else to use the wrench on." And that was a false herring that led the player to a wild goose chase.

Now there still is just one "right" screw to apply the wrench on. But Jake can now apply the wrench on every screw, too. If it's a "wrong" screw, then Jake remarks that "that one" is too tight to unscrew - so the player gets a big hint that other screws may not be too tight and they must continue trying the wrench on screws. There's less than a handful of screws so this isn't too onerous.
[close]
#248
Beginners' Technical Questions / Re: Room size
Wed 19/02/2020 17:01:31
Quote from: ld-airgrafix on Wed 19/02/2020 11:40:51
but when character moves together with camera, its really jerky, and not smooth. Is there anything i can do to improve this?

The fundamental reason is that the character's movement is jerky. It must be because the character can only move when the animation frame changes. (This is an effect that can be turned off in the Editor, but you'd usually not want to because it helps to prevent the character from slithering.) If the camera isn't locked to positions that are set manually, it moves with the character, and so it is jerky, too.

You can take control of the camera in the event repeatedly_execute or repeatedly_execute_always and see to it  that it only changes at most by a few pixels per call of that event. That's what I did for my game Mamma Mia Winter Ice Cream Mayhem. That game features fast movements when Jake starts up the ice cream maker, and I found that the jerky camera movements make the player giddy.

I'd post the code I used here, but that game was coded in AGS 3.4.1, and the respective concepts and functions have changed name and semantics in the meantime.
#249
Well, this turns out to have an unexpected resolution.

Crimson Wizard said that the version he checked was compiled in 3.4.2.1, but I _distinctly_ remembered having compiled the polished version under 3.5. So I checked just _what_ file was on the server, and … it turned out to be outdated. Something must have glitched when I uploaded the extended MAGS version so it never arrived on the server.

So now I've re-uploaded the correct version. The Engine identifies as 3.5.22, and now I can't make the game crash any more by banging the headlight onto the fingers.

@cat, I'm afraid you haven't been playing the polished MAGS version after all, but it's online now. The core gameplay hasn't changed, but the polished version features a Jake that can stoop.

Let's hope this resolves the issue!



#250
Ah at last! Thanks a lot, I've been able to call up the error.

The code right there is harmless IMO:
Spoiler

Use inventory on object event: oHandFingers_UseInv.

Code: ags
function DontUseThisDave()
{
    player.Say("I'm not sure that I want to throw this away.");
    player.Say("After all, I might need it later on.");
}

function oHandFingers_UseInv()
{
    DontUseThisDave();
}

[close]

Quote from: Crimson Wizard on Tue 18/02/2020 23:15:18
This game still uses AGS 3.4.2.1 (according to winsetup and ctrl+V info at least), which was the early alpha build of 3.5.0, and may contain numerous bugs, including mistakes with std::vectors (because I was replacing number of fixed arrays with vectors).

This might well be the case.  When I run the game in AGS 3.4.1, the error does not show up yet, no matter how often I bang the headlight onto the cloud hand.

The game is currently evolving, so I'll try to go back in time and find fthe source code state that corresponds to the (published) extended MAGS version. If that dumps with the most current compiler, editor, and engine, I'll assemble a bug report. Unfortunately, the whole source package is nearly a gig large because of the assets.

#251
Argh! I'd tried very hard to reproduce that bug but didn't manage to for all my efforts.

This is something that shouldn't be possible no matter how the adventure is coded: The engine itself that runs the adventure hits on a bug and dumps. If you've got any tips on how to reproduce this, I'd be very obliged, and Crimson Wizard for the AGS GIT project, too.

But it doesn't need to stop the adventure at all. Hint:
Spoiler
You needn't interact with the hand at all, it's the head you need to wake and talk to.
[close]
#252
By the way, by the symptoms I wouldn't be at all surprised when the microwave oven is opened ceremonially at the end of the year and no cupcake turns out to be in it after all. That is, no treaties whatsoever turn out to have been concluded anywhere, everyone everywhere has just been twiddling their thumbs, and the whole year has been wasted just like the three years preceding it.

So far, all the parties have been playing a wrong-headed game of “chicken” about a dealless Brexit since day one, so this could then plausibly continue straight on: Britain asking for a postponement at the very last minute to continue the status quo on an interim basis, all the 26 countries of the EU convening at the very very last minute and granting that as a very very very last chance, statements being made, sentiments being expressed, and Britain continuing to sit straddled on the fence for all eternity, cleaving her bum ever deeper and refusing to climb down on either side.

That is, of course, unless that cursed “chicken” game will suddenly go wrong in earnest sometime and there'll be a big traffic accident … :-\
#253
Quote from: Gilbert on Wed 12/02/2020 05:27:48
Supporting UTF-8 text is a much needed feature of AGS, it'd be great if the functionality of this plug-in can be incorporated into the engine itself.

Speaking of which, the Editor should accept and write source code in UTF-8, and the compiler should process such source code.

  • The definition of identifiers could remain the same (1st char a-z, A-Z, _; 2nd and following char a-z, A-Z, _, 0-9)
  • single-quoted  characters, e.g., 'ä', would be converted to integers in the range 0 … 65536
  • single-quoted characters could contain \x and \u sequences with high numbers, those would be converted into the corresponding integers
  • char would continue to be 0 … 255, and strings would continue to be char sequences, but could now contain UTF-8 sequences
  • double-quoted strings "…" could contain Unicode, which would be coded as UTF-8 sequences in the source file, e.g., "Frühstück"
  • double-quoted strings could contain \x and \u sequences with high numbers, those would expand into UTF-8 encoded Unicode

The nice thing about UTF-8 sequences is that they are guaranteed not to contain zeroes, so these changes would be sufficient as far as the compiler is concerned.

However, if an Engine function is passed a string that contains UTF-8 and if that Engine function isn't Unicode aware (yet) then it might garble the string or produce illegal UTF-8.

Pre-existing AGS bytecode that is only given strict ASCII as input will continue to work and ASCII source code can be directly "interpreted as" UTF-8, so those changes would be completely backward compatible.

The String class should probably need helper functions so that it is possible to iterate through its characters  even if some of those are UTF-8 sequences and need to be processed as one. For each String function we'd probably also need an additional function that works like the original but treats whole UTF-8 sequences as 1 character. This doesn't concern the compiler.
#254
Unfortunately, the assumption is flawed from the get-go that source terms and target terms are in n:1 correspondence. There's the grammar angle: The translation might need to be declined dependent on the context, which might require different articles in the translation as well as different word spellings.

English "bear"; German "Der Bär" / "des Bären" / "dem Bär," / "den Bären" depending on the context.

And there are cases where one term in the source language corresponds to completely different terms in the target language, never mind the article.
German: "Mutter", English "nut" / "mother" dependent on the context
English "scales"; German "Schuppen" / "Waage", dependent on the context.

If there are only a few ambiguous terms in your code, you might get by by using "scalesX" and "scalesY" in your code and then cutting off the last letter before showing the word on screen. Then the translators can convert "scalesX" to "SchuppenX" and "scalesY" to "WaageY", so that the right thing happens when the last letter is cut off. Or, using the code (N)ominative, (G)enitive, (D)ative, (A)ccusative, put "bearN", "bearG", "bearD"; "bearA" in the code and let them be translated to "der BärN", "des BärenG", "dem BärD", "den BärenA", respectively. However, there are still some cases where the target language uses different grammar cases than the source language: English "I (nominative) can't think of anything!" German "Mir (dative) fällt nichts ein!" French "Je (nominative) n'en ai aucune idée".

Or else, simply ignore the issue and provide bad translations. I seem to recall that most of the classic Point & Click games treated the Germans with poetic gems such as "Benutze Der Zahnbürste mit Der Bär", and nobody seemed to mind much.

By the bye: Translation friendly code should always prefer patching full sentences to piecing together parts. For instance, if you code
Code: ags
String verb = "take";
    String thing = "hammer";
    String s = "Should I " + verb " the " + hammer + "?";

then the translator might find that they ought to move the pieces around in the translation, but can't.
English: Should I take the hammer?
German: Soll ich den Hammer nehmen?
Or the typographic conventions differ, note the space before the question mark:
French: Il faut prendre le marteau ?

On the other hand, if you code
Code: ags
String s = "Should I <verb> the <thing>?"

... and then replace "<verb>" by the verb and "<thing>" by the thing,
then the German translator can translate that to : "Soll ich <thing> <verb>?" (changing the sequence), and the French translator to "Il faut <verb> <thing> ?" (adding the space).
Note that this, right here, is an instance where you have to deal with articles and grammatical cases in some way, too. "thing" might turn out to be male, female or neuter in different languages, and it will probably turn out to be accusative here, but nominative elsewhere.

Internationalization is harder than it seems at first glance.
#255
Quote from: cat on Thu 06/02/2020 08:42:53
what happened to ours about Cave of Avarice?

Yes, that's what I've been wondering, too. I've been looking forward to that interview.
#256
As I read it, there have always been three options on the table. They only were confounded into two options in various ways.

To be specific, there is

  • Hard Brexit (clean break)
  • Soft Brexit (e.g., Norwegian model)
  • Remain.
Take any two and you'll find that they are mutually incompatible -- but added mathematically, they cover a tight majority. Take any single one and you'll find that it could be implemented in principle -- but it's a minority position that has a resounding majority against it.

An that's the background in which the sorry saga played out thusly:

I. Corbyn: “Come on, people, we're still staying in, aren't we?” -- UK: “NAAAAAAY!”
The way that this question was worded confounds a Hard Brexit with a Soft Brexit -- and this is the explanation for that (in)famous result. But unfortunately, you can only have the one OR the other. So ...

II. May:“Fine, let's befuddle brexiting to specifically mean just soft brexiting. You're all for backstops and adhering to all EU regulations, aren't you?" -- UK: "NAAAAAAY!" -- May: “But that's the only thing I'm willing to champion! Let's retry EXACTLY the same!” -- UK: “BOOOOO!” -- May: “I covered my ears and didn't hear you! Let's retry!” -- UK: “BOOOOO!” -- May:“Retr....!” -- UK: “BOOOOO”  --  ... ad perpetuam.
By championing the Soft Brexit, May had forced the Hard Brexiters and the Remainers into a voting coalition that had a sound majority. But no actionable alternative.

III. Johnson (old tune): “So May was daft. Let's befuddle brexiting to mean hard brexiting instead. Everyone behind me?” --  UK: “NAAAAAAY!”  -- Johnson: “Bummer.”

Elections. The people: “We're SOOOO tired of that eternal darned confounded deadlock. This has become SOOOO old!”

IV. Johnson (suddenly changing the tune): “Right! I've got you covered! I've got such an exquisite three-star delicious gourmet microwave Brexit dish for you folks. The specific recipe details are my trade secret, but it'll only take five minutes, so help me Jupiter.”

-- and he came through and that's where we're standing now.

Most probably you'd still find the same three factions in the populace if you asked specifically enough, and in nearly unchanged quantities ever since Corbyn's time. But it seems that the people were so tired of that hard brexit, soft brexit conundrum that they were willing to let it be broken up any old how.
#257
Well, the Conservatives led by that microwave guy did get the majority, so I suppose the Brexiters had the approval of the British people after all.

And I really can't bring myself to believe that this very persistent separation will has just been founded on the Brexiters not knowing the (correct) "facts". Everyone that really wanted to learn these facts had great opportunities to do so, and more than two year's time for it, too. So I can only conclude that those facts weren't that relevant for the Brexiters' decision. There must have been other reasons, other circumstances, other facts that were more relevant to them than those facts that the Remainers always touted. I don't know. I don't think that the German media have done a good job of objectively understanding and explaining the core concerns of both sides -- I don't think they even tried --, so I can't claim to have an impartial and comprehensive view on the matter.

The EU's strategy or hope that the British separationist tendencies would somehow just  ... go away ... if they just keep staunchly talking them down and ignoring them has failed. That much is certain.

I don't think that the negotiations between the United Kingdom and the rest of the EU have even begun yet. The real negotiations will only start now, now that it is certain that the Brexit happens indeed. A lot of "red lines in the sand" will probably turn out to be a bit less immovable than they've been made out to be. The surprised public might even learn that there have been actual precedents for maxims that must never be put up for disposal under any circumstances.
#258
I noticed myself some time ago that the system will corrupt all the typographic quote marks “…” if I reopen an old post for modification through the small "Modify post" button at the end of a post. But if I reopen the same post with the big “Modify” button at the start of my post, it does not.

The quote marks are still fine when in the editing window, but when the window is saved, then the quote marks are corrupted. All the quote marks are corrupted no matter whether I touched them.

There's probably some rogue code at work that can't handle UTF8 unicode and that is called the one way but not the other.
#259
So we've got a light source that throws a conspicuous shadow behind a shovel.
player walks up to the shovel.
So now the light source would need to throw a conspicuous shadow behind player as well, wouldn't it?

And _that_ shadow is going to move around with player and probably change shape and size all the time …
#260
Quote from: Crimson Wizard on Fri 31/01/2020 10:03:22
The only issue I can think of here is the AGS room object limit

In that case, you could draw the room background to include all the the object shadows and also prepare for each object a separate sprite that "edits out" the respective shadow. After all, there's no (onerous) limit on the number of _sprites_.

When player picks up the shovel, draw the "edit out" sprite directly onto the background at the place that the shadow of the shovel is. Shadow gone.
SMF spam blocked by CleanTalk