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 - Monsieur OUXX

#541
Quote from: Crimson Wizard on Tue 03/07/2018 15:22:38
This is the first time I hear about this, is there an issue opened in the tracker? How do you reproduce it at least?

Last time I mentionned it, Monkey0506 said "but why don't you comment the code instead of changing it directly and relying on Ctrl+Z?". It's definitely a thing, and it has been for many, many versions.

Scenario :
- Open an script (any script)
- change anything in it
- Do Ctrl+S
- As soon as the file gets saved, you cannot "Undo". All the undo steps get flushed.
#542
I just fell victim of "No Edit-->Undo after saving a script file" which made me lose hours of work EDIT: After two years using Dropbox, its "history" feature finally came to the rescue :P .
I know it's a known behaviour but it infuriates me.
#543
I thought I was understanding the script, but I don't. Too many coordinates transformations for my little brain. Anyone could put me in the right direction to add arbitrary edges within the room that lock the scrolling, in replacement of ((0,0), (Room.Width, Room.Height)) ? I don't care if that breaks the parallax, I just need to block the scrolling beyond those edges.

EDIT : I got tired of (failing) to do it elegantly, so instead I went brute force, like this :

Code: ags

        //COMMENTED OUT
        //SetViewport(FloatToInt(ScreenCentreX, eRoundDown) - HalfScreenWidth, FloatToInt(ScreenCentreY, eRoundDown) - HalfScreenHeight); // Set the Viewport position relative to ScreenCentreX and Y.  

        //NEW SCRIPT
        int x = FloatToInt(ScreenCentreX, eRoundDown) - HalfScreenWidth;
        int y = FloatToInt(ScreenCentreY, eRoundDown) - HalfScreenHeight;
        
        if (x<edgeLeft)
            x = edgeLeft;
        else if (x+System.ViewportWidth > edgeRight)
            x = edgeRight-System.ViewportWidth;
        

        if (y<edgeTop)
            y = edgeTop;
        else if (y+System.ViewportHeight > edgeBottom)
            y = edgeBottom-System.ViewportHeight;
        
        
        SetViewport(x, y);


The scrolling doesn't stop as smoothly when the player reachs the edges, but it totally fools the eye for someone who's not seen the original smoothness.
#544
Coincidence : I also need to post a question about this module right now. Let me know if it interferes with the other conversation.

Spoiler

I'm trying to set up "edges" to the smooth scrolling. What I mean is this : imagine you're in a room that's 600x600. You set up "edges" like this: (Left=100, right = 500, top=100, bottom=500). That's a 400x400 area.
- I want that no matter where the character walks, the viewport never exits that area.
- However when the player character is within that area, then the smooth scrolling follows it normally.

How would I achieve that?
[close]
EDIT: I'm in the process of succeeding.
Well I'm not :(
#545
Quote from: cat on Mon 21/05/2018 20:45:47
One more (not exactly MonoAGS) issue I have: I installed the VS Community Edition, which I thought was free? But now VS says that my 30 days trial license will expire in a few days ???

Sometimes the installer is the same but it's the license that matters. Check in google if there isn't a thing like "get your VS community key" which might lead you to a page where all you have to do is to provide your (any) email address to get the key.
Nowadays most of the time you can even generate a key directly from within VS. Chek ou the "help" or "tools" menu.
#546
Critics' Lounge / Re: Hand-drawn to pixel scan
Tue 22/05/2018 14:32:48
Quote from: ElerosVecchio on Sun 20/05/2018 22:17:00
I was wondering if you thought it would be a viable option for pixel art.

I think you don't get very constructive feedback because people are puzzled by what you expect.
That guitar is in low resolution, but not very low resolution. So I think that people have the feeling that all you had to do was to follow the lines of your drawing, and you had an immediate result -- the fact that you used a handful of plain colors with no shading makes this feeling even more vivid.
I myself am wondering -- and I'm really asking in good faith -- why you did not directly draw that handful of straight lines directly with the MS Paint tool.
Or, if I take the process from the other end : If I had gone through the trouble of hand-drawing it, then I would have kept a sufficient resolution to have nice curves on the final result (moving away from pixel art).

Maybe there's something that we don't get here : maybe there's a broader context to your question. Are you planning on using this same process on many graphics, and this guitar is just a test run?
Or are you trying to learn actual pixel art? If so, then I would recommend to lower the final resolution even more -- so that you learn how to fool the eye into seeing curves when there are only big square pixels.


#547
:-D
#548
You're seriously good at animations.
At first I was skeptical about the hi-res-but-not-hi-enough-not-to-need-antialias, but in the end it turns out wonderfully.
Since it's so awesome, have you considered doing 8 angles for the main character instead of just 4?Then your game would look 200% smooth.
#549
another approach : try this as a proof of concept in your global script and then if it works try to make it cleaner by moving it to your room script :

Code: ags


bool isOnTopOfLadder = false;

void blockWalking()
{
   if (player.Room == /* the room where it's supposed to blok */)
   {
       isOntopOfLadder = /* conditions to return true if he's supposed to be on top of ladder */;

       if(isOnTopOfLadder)
       {
           if(player.Moving)
           {
               player.StopMoving();
           }

           //Do this only if needed
           player.LockView(/* the view wheree stands still at the top of te ladder */);
       }
    }
}

//block the walk at the beginning of the game loop
void repeatedly_execute_always()
{
    blockWalking();
}

//block the walk at the end of the game loop too (just in case)
void late_repeatedly_execute_always()
{
    blockWalking();
}


#550
Itis ndeed not used, however that's not the important thing about the Splashscree room.
the important thing is that it has a different structure from the other rooms. It is designed to have an unpredictable framerate, which means that onRepeatelyExecute and the tweens update are called manually from this room's loading function itself.
If you don't feel too confortable with that weird room, I'd say that you may skip the splash screen altogether and just go directly to an actual room. It will take a few seconds to load, but for a small game it's no big deal.


#551
Hurray!
#552
Quote from: tzachs on Sun 13/05/2018 05:50:53
Permission to copy?

Well duh (laugh);)

Here:
Code: ags

[url=https://tzachshabtay.github.io/MonoAGS/][img]https://bit.ly/2Ih2c15[/img][/url]
#553
OK, thanks.

Based on these sources, does anyone understand why the word "Loading" does not appear?

FakeAGSTestGame/Assets/Rooms/Splashscreen/RoomScript.cs
FakeAGS/Rooms/FakeAGSLoadingScreen.cs


#554
I'm currently writing that loading/unloading.
For now I don't care if the state of the room is not kept in-between visits. I'll start with a simple behavior.
How do you unload things?
#555
Right now I'm struggling understanding how the rooms work! Again I'm baging my head against the wall because of all the asbstraction.

Can you confirm that this is the lifecycle of a room :

Code: ags

CustomRoom customRoom = new CustomRoom(player) //by the way wouldn't it be more efficient to provide "game" straight away?
Task<IRoom> roomTask = customRoom.LoadAsync(game)
--->      IRoom room = factory.Room.GetRoom(_roomId, 20f, 310f, 190f, 10f); //Creates some dummy room object?
         //...fill all the room's attributes

waitForRoom(game, roomTask )
--->     game.State.Rooms.Add(room)


And then at any time later in the game, whenever something happens that might have broken a pointer to a room (like restoring a saved game) :
Code: ags

_updatedRoomReference = Rooms.Find(_game.State, _oldRoomReference); //This just looks up the room with the same ID as the old reference


#556
Something is bugging me because I wrote nice code based on ResourcePacks to load the XML file that defines the title, width and depth of the game... But then I realized that game.Factories.Resources is not populated until after calling game.Start (to which you must pass the settings).

You need the resources to get the settings to call game.Start, and you need to call game.Start to get the resources to get the settings. >:(

Oh well. At least my construct works for everything else but the early initialization.
#557
By the way CW I made a mistake when I said that all the resources are loaded. What happens is that all the files get open, as Streams. But not necessarily read. Each resource as a handle to a file. I still don't know how it's supposed to be handled cleanly outside of the built-in resources like Fonts, etc. For now I'm leaving the streams open when reading my XML files.
#558
Quote from: Crimson Wizard on Fri 11/05/2018 18:11:52
an alternate approach / temporary workaround may be to have a "master" xml file that would hold a list of paths to other xmls
Game designers have no time to lose ;) Implicit all the way! Yaaaay! ;)


Quote from: Crimson Wizard on Fri 11/05/2018 18:11:52
@tzachs, if resources are actually always loaded for real when calling "Load"
I wasn't sure either, so I digged and I actually think they are. So my approach of doing some sort of "pre-load" by just searching the definition files (xml files) might come handy for memory management too. In other words: I know that there's something there on disk and I know what it is from the XML file, but I can load or unload it at will.



Quote from: Crimson Wizard on Fri 11/05/2018 18:11:52
@tzachs, BTW, do you think it may make sense to provide a "file tree" interface to iterate asset entries, instead of call "load" for them?
I actually just did that with my AssetDefsFactory.Process(wildcard). Internally it's not a tree but that's the idea.


You can see more from my repo by paying attention to that bit :
Code: ags


                List<IAssetDef> gameAssetsDefs = new AssetDefsFactory(game, resources).Process("*/Game/*");
                var roomsAssetsDefs = new AssetDefsFactory(game, resources).Process("*/Rooms/*");

                string customRes = gameAssetsDefs.First().GetValue("CustomResolution");
                Debug.WriteLine($"Debug : Custom resolution is : '{customRes}'");

(well, for the game settings it doesn't load anything deeper than root level, but for rooms it will)

Please note though that this code is horrible and slow. But it is an embryo of those concepts.
#559
Quote from: Crimson Wizard on Fri 11/05/2018 16:21:03
For that reason I've been asking Monsieur OUXX what he is trying to do several times, but he does not want to tell :(.
Sorry I felt like my plan was crystal clear since I keep repeating what I want to do (with poor words). I want to add an extra method to ResourcesLoader that loads resources recursively. It scans all subfolders aof the Assets folder, and it also checks if there is an XML file in it.
Since all the classes involded have all their helper functions private, then (even with composition) I have to pretty much reprogram the whole system alongside the original one, by duplicating 95% of its code and changing just 5%. Don't you think it's a pity?

You can see how I've done it here : https://github.com/jeancallisti/fakeags/blob/master/FakeAGS/FakeAGS/Engine/FakeAGSResourcePack.cs
(follow the call stack of LoadAllDefinitionsRecursively )
#560
Quote from: Crimson Wizard on Fri 11/05/2018 14:20:32
do you mean actually Loader, or ResourcePack implementation?
Well it would actually have to be both : ResourcePack has to be implemnted in as many flavors as there are potential file systems, but then it's really ResourceLoader that you use to start the loading (and it chooses between its resource packs behind the scene, but you're not supposed to really care about that).

Quote from: Crimson Wizard on Fri 11/05/2018 14:20:32
Also, if you think that these changes could be useful, maybe suggest them to the engine code?
Yes, but for now I'd rather priviledge a workflow where I'm 100% in control of what I'm doing, with dirty hacks here and there (quick iterative method). I also want to be as little intrusive as possible. Once I have something that works I can initiate a conversation with tzachs to draw his attention to useful bits of my utility code, and let him pick what he likes. Then I can add it to MonoAGS myself.
SMF spam blocked by CleanTalk