Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, AndrewAMD), 877 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 12 1 2 3 4 5 6 7 11 12
Re: A7ITUDE poc-02 'buttercream' announced [Re: HeelX] #437682
02/22/14 13:41
02/22/14 13:41
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Wouldn't it be easier to pick the color from a rgb dialog?

Re: A7ITUDE poc-02 'buttercream' announced [Re: oliver2s] #437685
02/22/14 20:24
02/22/14 20:24
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
For my use case it is very important to pick from the screen. I want to derive colorschemes from existing photographs, images and so on to get a coherent look.

Update: A7ITUDE poc-02 'buttercream' [Re: HeelX] #437949
03/02/14 13:58
03/02/14 13:58
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
OK, here is a (rather technically) update for the current PoC. The PoC itself is not finished yet, but I finished an important piece - and I am very VERY satisfied with this, so I thought I might share this. Maybe you glanced some screenshots beforehand about this.

Well, I was working the last weeks in my spare time (which was highly ultra spare due to a number of certain recent events) on a number of code related things to ultimately support the following use case:

1) extract a color schema from an image / the screen as XML file
2) load the XML file into the game (from plain XML file or encrypted WRS)
3) create game objects with their current schema color accordingly

This is intended for:

a) fast and easy creation/modifaction of a puzzle's look because of human readible schema files
b) loose coupling (colors are defined outside the game)
c) update friendliness
d) end-user SDK / game editor capability

For this, I implemented the following, which took much more time than I expected:

- First I chose to include a XML parser as DLL, but decided against that. Now, I ported the opensource C++ irrXML XML parser to Lite-C and added a SAX-like interface.
- This included the implementation of i) a new String library with my own (dynamic) String type and functions to support the XML parser and ii) a (dynamic) pointer arraylist.
- a standalone JAVA client GUI, that makes it possible to click a pixel on the screen and fetch it's color.

This is now finally done. It is not polished, but it works reliable.

Example: In the following screenshot you can see, that I took a a picture of me and uploaded it into ColorLover's photocopa web tool, to create a a colorscheme ("Overseas Highway") from it. With the tool, I extracted the colors and saved it as XML.



In the game, I just call

Code:
AvColorSchema* avColorSchema = loadColorSchemaFromXml(xmlFilename);



which essentially executes

Code:
AvColorSchema* avColorSchema = avColorSchemaCreate();

AvXmlCallback callback;

memset(&callback, 0, sizeof(AvXmlCallback));
callback.clientData = avColorSchema;
callback.evOpeningElement = loadColorSchemaFromXml_ev;

bool xmlReadSuccess = avXmlRead(xmlFilename, &callback);



The event loadColorSchemaFromXml_ev is called on each opening XML element and includes the logic to fill the AvColorSchema object, which is always passed as reference with the callback-call:

Code:
void loadColorSchemaFromXml_ev(AvString* xmlName, AvPtrArray* xmlAttributes, AvXmlReader* xmlReader, void* clientData)
{
   AvColorSchema* avColorSchema = (AvColorSchema*) clientData;

   // colorschema name
   if (avStrEqualsIgnoreCaseAscii(xmlName, "colorSchema")) {
      AvXmlAttribute* nameAttr = avXmlReaderGetAttributeByName(xmlReader, "name");
      avStrSet(avColorSchema->name, avXmlAttributeValue(nameAttr));
   } else {

      // named color
      if (avStrEqualsIgnoreCaseAscii(xmlName, "namedColor")) {

         // create new color
         AvNamedColor* namedColor = avNamedColorCreate();

         // set name
         AvXmlAttribute* nameAttr = avXmlReaderGetAttributeByName(xmlReader, "name");
         avStrSet(namedColor->name, avXmlAttributeValue(nameAttr));

         // add color
         avColorSchemaAddColor(avColorSchema, namedColor);

      } else {

         // color
         if (avStrEqualsIgnoreCaseAscii(xmlName, "rgbColor")) {

            int r = avXmlReaderGetAttributeValueAsInt(xmlReader, "r");
            int g = avXmlReaderGetAttributeValueAsInt(xmlReader, "g");
            int b = avXmlReaderGetAttributeValueAsInt(xmlReader, "b");

            AvNamedColor* namedColor = avColorSchemaGetLastColor(avColorSchema);
            if (namedColor != null) {
               avRgbColorSetRGB(namedColor->rgbColor, r, g, b);
            }
         }
      }
   }
}



This is pretty straightforward, I think. And it works great! Here is a screenshot of the scheme applied to my test setup:



In addition, I also refactored my whole shading setup and took massive advantage of the HLSL include feature JCL added to the engine in the last update. It is a blast, in total, my shader code is so much smaller, because I was able to split it into several building blocks smile this is so great!

After polishing the code, I will eventually release the code of the XML reader / String library / pointer arraylist soon to the public, if anyone is interested. I call the core library behind my game "Avalanche", just in case you are wondering why there is always an "av" before each type and function wink

Re: Update: A7ITUDE poc-02 'buttercream' [Re: HeelX] #443381
07/14/14 21:44
07/14/14 21:44
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Still alive. Still codin'. A7ITUDE.

Invested much time into XML parsing, Object/Class emulation and an own Task / Scheduling framework. So no new eye candy, sorry. But things are moving!


Re: Update: A7ITUDE poc-02 'buttercream' [Re: HeelX] #443390
07/15/14 08:37
07/15/14 08:37
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
And your current thoughts about jMonkey are...? laugh

Re: Update: A7ITUDE poc-02 'buttercream' [Re: HeelX] #443391
07/15/14 08:40
07/15/14 08:40
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Originally Posted By: HeelX
Still alive. Still codin'. A7ITUDE.

Invested much time into XML parsing,[...]

Don't tell me you wrote your own parser o.O


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Update: A7ITUDE poc-02 'buttercream' [Re: Rackscha] #443402
07/15/14 18:57
07/15/14 18:57
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Originally Posted By: PadMalcom
And your current thoughts about jMonkey are...? laugh
It is a super cool engine! I can tell you my plans this weekend, but I plan to port the puzzle editor as soon as possible. Because of some health reason I plan to develop the most of the game in my bed or on my couch wink

Originally Posted By: Rackscha
Don't tell me you wrote your own parser o.O
No, but I ported irrXML for Lite-C.

Last edited by HeelX; 07/15/14 18:58.
Re: Update: A7ITUDE poc-02 'buttercream' [Re: HeelX] #443405
07/15/14 19:52
07/15/14 19:52
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Originally Posted By: HeelX

Originally Posted By: Rackscha
Don't tell me you wrote your own parser o.O
No, but I ported irrXML for Lite-C.

Ahhh^^


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

glossy shaders! (human after all) [Re: HeelX] #443900
07/27/14 19:12
07/27/14 19:12
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
A7ITUDE is still a little thing.
What am I going to do?
Making a big difference.

So I wrote some glossy shaders today (A8 screenshots!).


Last edited by HeelX; 07/27/14 19:20.
Re: glossy shaders! (human after all) [Re: HeelX] #443915
07/27/14 21:23
07/27/14 21:23
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
Very nice! Is that your house or apartment in the environment map or something else?


Eats commas for breakfast.

Play Barony: Cursed Edition!
Page 5 of 12 1 2 3 4 5 6 7 11 12

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1