Re: [Gambas-user] Gambas was live on Twitch
Le 11/09/2015 04:20, Kevin Fishburne a écrit : > On 09/10/2015 10:02 PM, Benoît Minisini wrote: >> Le 11/09/2015 03:52, Kevin Fishburne a écrit : >>> On 09/09/2015 07:28 AM, Benoît Minisini wrote: Hi Kevin, Looking quickly at your live twitch, I noticed that apparently, if I'm not wrong, you are not aware of the difference between: If A And B And C Then And: If A And If B And If C Then "And" must be used for binary computation. "And If" should always be used for tests. It is faster, as it only executes a test if the previous is TRUE, while "And" always evaluates all its operands. I think you will agree to save a few CPU cycles, do you? :-) Regards, >>> That is an awesome tip. I actually had wondered if there was a way to do >>> this, or if Gambas would abort subsequent tests automatically if one was >>> found to be False. I didn't realize I could just stick multiple Ifs in >>> there. Thanks! >>> >> By the way, do you use the IDE profiler to detect where you use most of >> the CPU? >> > > That sounds like something an actual programmer would do, so no. :) Is > there a tutorial on the wiki that explains the basics? So far I've been > optimizing as I go, but I haven't taken the time to do any real analysis > to find problem areas. I'd probably start by examining the execution > time of each procedure call in the "main loop", then getting more granular. > Just run it, and look at the tables it shows you. -- Benoît Minisini -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
Le 11/09/2015 04:15, Jussi Lahtinen a écrit : > If ObjModel.Load() turns out to be the bottleneck, you can convert the MD2 > files (always make back up of the originals) as binary. And thus load them > directly to the arrays, which is much faster. > > > > Jussi > That routine should be first optimized in Gambas. Remember that the compiler does not detect constant expressions and evaluates everything. For example, if you do successively: a.b.xxx a.b.yyy a.b.zzz you are evaluating a.b several times for nothing. By putting "a.b" in a local variable, you speed things up. If awa is faster than: If awa <> "" And is Split() mandatory? And so on... And the profiler can help there. -- Benoît Minisini -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
On 09/10/2015 10:02 PM, Benoît Minisini wrote: > Le 11/09/2015 03:52, Kevin Fishburne a écrit : >> On 09/09/2015 07:28 AM, Benoît Minisini wrote: >>> Hi Kevin, Looking quickly at your live twitch, I noticed that >>> apparently, if I'm not wrong, you are not aware of the difference >>> between: If A And B And C Then And: If A And If B And If C Then "And" >>> must be used for binary computation. "And If" should always be used >>> for tests. It is faster, as it only executes a test if the previous is >>> TRUE, while "And" always evaluates all its operands. I think you will >>> agree to save a few CPU cycles, do you? :-) Regards, >> That is an awesome tip. I actually had wondered if there was a way to do >> this, or if Gambas would abort subsequent tests automatically if one was >> found to be False. I didn't realize I could just stick multiple Ifs in >> there. Thanks! >> > By the way, do you use the IDE profiler to detect where you use most of > the CPU? > That sounds like something an actual programmer would do, so no. :) Is there a tutorial on the wiki that explains the basics? So far I've been optimizing as I go, but I haven't taken the time to do any real analysis to find problem areas. I'd probably start by examining the execution time of each procedure call in the "main loop", then getting more granular. -- Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: sa...@eightvirtues.com phone: (770) 853-6271 -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
If ObjModel.Load() turns out to be the bottleneck, you can convert the MD2 files (always make back up of the originals) as binary. And thus load them directly to the arrays, which is much faster. Jussi On Fri, Sep 11, 2015 at 5:02 AM, Kevin Fishburne < kevinfishbu...@eightvirtues.com> wrote: > On 09/09/2015 09:08 AM, Tobias Boege wrote: > >> On Wed, 09 Sep 2015, Kevin Fishburne wrote: >> >>> The actual mechanics for loading the assets are Tobias Boege's >>> ObjModel.class for loading Wavefront OBJ files (3D models) >>> >> Are you sure it's my code? I don't even know what a Wavefront is :-) >> But I haven't found any mention of ObjModel in my mail archives so I >> can't properly attribute the class to anyone else... OTOH, if it causes >> slowdowns it might very well be mine... :-) >> > > Hi Tobi. I think it was you. I believe it is the same author as the MD2 > loading/animation class included as an example in Gambas, but that you'd > never published/distributed it. I've attached the class (with a few > modifications by me) to this email. Basically it has a method to load OBJ > files (exported from Blender) into a display list and a method to > draw/render the list. It has no animation or material support, but works > great. > > > -- > Kevin Fishburne > Eight Virtues > www: http://sales.eightvirtues.com > e-mail: sa...@eightvirtues.com > phone: (770) 853-6271 > > > > -- > > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > > -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
On 09/09/2015 09:08 AM, Tobias Boege wrote: On Wed, 09 Sep 2015, Kevin Fishburne wrote: The actual mechanics for loading the assets are Tobias Boege's ObjModel.class for loading Wavefront OBJ files (3D models) Are you sure it's my code? I don't even know what a Wavefront is :-) But I haven't found any mention of ObjModel in my mail archives so I can't properly attribute the class to anyone else... OTOH, if it causes slowdowns it might very well be mine... :-) Hi Tobi. I think it was you. I believe it is the same author as the MD2 loading/animation class included as an example in Gambas, but that you'd never published/distributed it. I've attached the class (with a few modifications by me) to this email. Basically it has a method to load OBJ files (exported from Blender) into a display list and a method to draw/render the list. It has no animation or material support, but works great. -- Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: sa...@eightvirtues.com phone: (770) 853-6271 ObjModel.class Description: application/java -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
Le 11/09/2015 03:52, Kevin Fishburne a écrit : > On 09/09/2015 07:28 AM, Benoît Minisini wrote: >> Hi Kevin, Looking quickly at your live twitch, I noticed that >> apparently, if I'm not wrong, you are not aware of the difference >> between: If A And B And C Then And: If A And If B And If C Then "And" >> must be used for binary computation. "And If" should always be used >> for tests. It is faster, as it only executes a test if the previous is >> TRUE, while "And" always evaluates all its operands. I think you will >> agree to save a few CPU cycles, do you? :-) Regards, > > That is an awesome tip. I actually had wondered if there was a way to do > this, or if Gambas would abort subsequent tests automatically if one was > found to be False. I didn't realize I could just stick multiple Ifs in > there. Thanks! > By the way, do you use the IDE profiler to detect where you use most of the CPU? -- Benoît Minisini -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
On 09/09/2015 07:28 AM, Benoît Minisini wrote: > Hi Kevin, Looking quickly at your live twitch, I noticed that > apparently, if I'm not wrong, you are not aware of the difference > between: If A And B And C Then And: If A And If B And If C Then "And" > must be used for binary computation. "And If" should always be used > for tests. It is faster, as it only executes a test if the previous is > TRUE, while "And" always evaluates all its operands. I think you will > agree to save a few CPU cycles, do you? :-) Regards, That is an awesome tip. I actually had wondered if there was a way to do this, or if Gambas would abort subsequent tests automatically if one was found to be False. I didn't realize I could just stick multiple Ifs in there. Thanks! -- Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: sa...@eightvirtues.com phone: (770) 853-6271 -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
I initially noticed the slow loading from some demo version you shared to the list. There are games having more than 1 GB of data which still loads faster. So, I'm pretty sure you do something in suboptimal way. If you can show some code there are people who could help you. Jussi On Wed, Sep 9, 2015 at 7:25 AM, Kevin Fishburne < kevinfishbu...@eightvirtues.com> wrote: > On Tue, Sep 8, 2015 at 10:25 AM, Kevin Fishburne < > kevinfishbu...@eightvirtues.com> wrote: > >> This is the Twitch export (to YouTube) of the live stream I broadcast > >> earlier this evening: > >> > >> https://youtu.be/lPUDxkkb4u4?t=5m30s > >> > >> 46 minutes of me working on OpenAL in Sylph using the stable Gambas PPA > >> on Linux Mint 17.2 Cinnamon. I probably needed more beer. > > On 09/08/2015 04:47 PM, Jussi Lahtinen wrote: > > I'm sure your game loading times could be heavily optimized. > > What method you use? Are you loading everything once, or rest by demand? > > > > Hey Jussi. It loads most game assets on startup, although between stages > it loads stage-specific color, sprite and wall (OBJ model files) data. > Generally all the other data is shared between stages. I do this partly > for convenience but mostly because I want to minimize load times between > stages and eliminate any "load lag" or frame-dropping during actual > gameplay. The game's fast, so the smoother it remains during play the > better the experience for the player. The philosophy here is "feel the > pain once, then forget it ever happened". > > The actual mechanics for loading the assets are Tobias Boege's > ObjModel.class for loading Wavefront OBJ files (3D models), Image.Load() > for OpenGL textures and Alure.BufferDataFromFile() for OpenAL audio > samples. When a stage is loaded is also creates arrays of display lists > so they can be shown dynamically according to an arbitrary view distance > in order to increase performance. > > I think the main reasons it took so long in the video is that I recently > downgraded my workstation to older hardware (don't ask...) and it is > loading all assets over an NFS share. Despite the gigabit LAN it's still > slower than a mechanical drive or SSD. In any case, the initial load > time is only going to get slower as more assets are added to the game, > though I don't imagine it'll become unbearable by the end (less than 60 > seconds, hopefully, on a decent system). > > -- > Kevin Fishburne > Eight Virtues > www: http://sales.eightvirtues.com > e-mail: sa...@eightvirtues.com > phone: (770) 853-6271 > > > > -- > Monitor Your Dynamic Infrastructure at Any Scale With Datadog! > Get real-time metrics from all of your servers, apps and tools > in one place. > SourceForge users - Click here to start your Free Trial of Datadog now! > http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
On Wed, 09 Sep 2015, Kevin Fishburne wrote: > The actual mechanics for loading the assets are Tobias Boege's > ObjModel.class for loading Wavefront OBJ files (3D models) Are you sure it's my code? I don't even know what a Wavefront is :-) But I haven't found any mention of ObjModel in my mail archives so I can't properly attribute the class to anyone else... OTOH, if it causes slowdowns it might very well be mine... :-) Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -- Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
Le 09/09/2015 06:25, Kevin Fishburne a écrit : > On Tue, Sep 8, 2015 at 10:25 AM, Kevin Fishburne < > kevinfishbu...@eightvirtues.com> wrote: >>> This is the Twitch export (to YouTube) of the live stream I broadcast >>> earlier this evening: >>> >>> https://youtu.be/lPUDxkkb4u4?t=5m30s >>> >>> 46 minutes of me working on OpenAL in Sylph using the stable Gambas PPA >>> on Linux Mint 17.2 Cinnamon. I probably needed more beer. > > On 09/08/2015 04:47 PM, Jussi Lahtinen wrote: >> I'm sure your game loading times could be heavily optimized. >> What method you use? Are you loading everything once, or rest by demand? >> > > Hey Jussi. It loads most game assets on startup, although between stages > it loads stage-specific color, sprite and wall (OBJ model files) data. > Generally all the other data is shared between stages. I do this partly > for convenience but mostly because I want to minimize load times between > stages and eliminate any "load lag" or frame-dropping during actual > gameplay. The game's fast, so the smoother it remains during play the > better the experience for the player. The philosophy here is "feel the > pain once, then forget it ever happened". > > The actual mechanics for loading the assets are Tobias Boege's > ObjModel.class for loading Wavefront OBJ files (3D models), Image.Load() > for OpenGL textures and Alure.BufferDataFromFile() for OpenAL audio > samples. When a stage is loaded is also creates arrays of display lists > so they can be shown dynamically according to an arbitrary view distance > in order to increase performance. > > I think the main reasons it took so long in the video is that I recently > downgraded my workstation to older hardware (don't ask...) and it is > loading all assets over an NFS share. Despite the gigabit LAN it's still > slower than a mechanical drive or SSD. In any case, the initial load > time is only going to get slower as more assets are added to the game, > though I don't imagine it'll become unbearable by the end (less than 60 > seconds, hopefully, on a decent system). > Hi Kevin, Looking quickly at your live twitch, I noticed that apparently, if I'm not wrong, you are not aware of the difference between: If A And B And C Then And: If A And If B And If C Then "And" must be used for binary computation. "And If" should always be used for tests. It is faster, as it only executes a test if the previous is TRUE, while "And" always evaluates all its operands. I think you will agree to save a few CPU cycles, do you? :-) Regards, -- Benoît Minisini -- Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
On Tue, Sep 8, 2015 at 10:25 AM, Kevin Fishburne < kevinfishbu...@eightvirtues.com> wrote: >> This is the Twitch export (to YouTube) of the live stream I broadcast >> earlier this evening: >> >> https://youtu.be/lPUDxkkb4u4?t=5m30s >> >> 46 minutes of me working on OpenAL in Sylph using the stable Gambas PPA >> on Linux Mint 17.2 Cinnamon. I probably needed more beer. On 09/08/2015 04:47 PM, Jussi Lahtinen wrote: > I'm sure your game loading times could be heavily optimized. > What method you use? Are you loading everything once, or rest by demand? > Hey Jussi. It loads most game assets on startup, although between stages it loads stage-specific color, sprite and wall (OBJ model files) data. Generally all the other data is shared between stages. I do this partly for convenience but mostly because I want to minimize load times between stages and eliminate any "load lag" or frame-dropping during actual gameplay. The game's fast, so the smoother it remains during play the better the experience for the player. The philosophy here is "feel the pain once, then forget it ever happened". The actual mechanics for loading the assets are Tobias Boege's ObjModel.class for loading Wavefront OBJ files (3D models), Image.Load() for OpenGL textures and Alure.BufferDataFromFile() for OpenAL audio samples. When a stage is loaded is also creates arrays of display lists so they can be shown dynamically according to an arbitrary view distance in order to increase performance. I think the main reasons it took so long in the video is that I recently downgraded my workstation to older hardware (don't ask...) and it is loading all assets over an NFS share. Despite the gigabit LAN it's still slower than a mechanical drive or SSD. In any case, the initial load time is only going to get slower as more assets are added to the game, though I don't imagine it'll become unbearable by the end (less than 60 seconds, hopefully, on a decent system). -- Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: sa...@eightvirtues.com phone: (770) 853-6271 -- Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas was live on Twitch
I'm sure your game loading times could be heavily optimized. What method you use? Are you loading everything once, or rest by demand? Jussi On Tue, Sep 8, 2015 at 10:25 AM, Kevin Fishburne < kevinfishbu...@eightvirtues.com> wrote: > This is the Twitch export (to YouTube) of the live stream I broadcast > earlier this evening: > > https://youtu.be/lPUDxkkb4u4?t=5m30s > > 46 minutes of me working on OpenAL in Sylph using the stable Gambas PPA > on Linux Mint 17.2 Cinnamon. I probably needed more beer. > > -- > Kevin Fishburne > Eight Virtues > www: http://sales.eightvirtues.com > e-mail: sa...@eightvirtues.com > phone: (770) 853-6271 > > > > -- > ___ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user > -- ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user