World Editor touchdown

Coordinator
May 1, 2009 at 4:10 AM
I will check the world editor out. It should be fun, I think it would be cool to put in a Scale/rotation/translate tool similar to Blender and in the Dragon Age World editor too.
I have allot of of experience with Unreal Editor and game editors in general too. I made allot of UT maps.

I am also thinking we could somehow create random dialog within quests somehow. Something where we could create a random game almost just with a button click. Of course you want to create a solid story right now which I think is great but it can be modified. Just some ideas.


Coordinator
May 1, 2009 at 4:27 AM
I think it looks great so far. For SmartMap I have started to implement a tileset (module) locator textbox but have not finished it yet. You select the module and then it brings the camera there as well as showing it in the UI etc.
Maybe later induvisual tiles can be slelected and be modified. For this editor it would go into the Grid system so you could select any object and not just a tile.
Developer
May 1, 2009 at 10:10 AM
Edited May 1, 2009 at 10:24 AM
Since we have only 2D grids, it is enought to represent them as 2D image objects on a 2D grid system. we have a chance to NOT USE Axiom on WorldEditor, .NET PictureBoxes are enough for our purpose. I am aiming to not use Axiom3D on WorldEditor & LevelEditor, so also not to use on RolePlayingGame.World. They will be focused as base classes that can be drawn by any render engine,
since it is a good thing i think.
 
The tabs which sided on left represent the layers and the grided Level Panel on the center will be change its objects with tab click, (forex: click on the lights and only lights will be shown on the main grid panel,

i also wrote Rotation enumeration and objects will have ability to rotated on 90 degree and its multipliers (0, 90, 180,270 degrees) on RolePlayingGame.World

The list box (in the tabs sided on left), will hold object originals as templates, and the instances on the level will not have list view on anywhere, they can be just selected by clicking them on the main gridded panel on the center.

For randomization, it can be implemented as another class on RolePlayingGame.World (not RolePlayingGame.WorldEditor)
and only a button can be add toWorldEditor that calls the world itself
(like GridBasedLevel level = world.GenerateRandomLevel()).

I think you would be glad to implement that kind of method (since it would be be the future of smartMap, a brand new SmartMap_Core that uses RolePlayingGame.World), and we could make another gui specific to SmartMap that takes many parameters to create a randomize complex maze level using base RolePlayingGame.World classes.

I know it looks wierd that SmartMap will be derived from RolePlayingGame namespace. Since RolePlayingGame is a temporary namespace name (currently we have not any name for our RPG Engine), we will change its name to more generic name later, So deriving SmartMap from that namespace will be more bearable/acceptable.
Coordinator
May 1, 2009 at 5:33 PM
2D is fine since it is mainly random. I always thought 2D would be fine for painting a world more quickly.
You can integrate my SmartMapCore code into your code so it will make it easier for you to add and graph varoius media as well as using the quickgraph search for navigation if you want. I will need SmartMapCore folder to remain still for others that want to use SmartMapCore and it will still have it's own license.

Only thing is I am not sure how well the LPGL fits since it is library focussed and not code, I don't think. I don't think you can intigrate code into your project outside using a library. So I put SmartMap_Core under BSD License. You can license your deriviative works any way you want, closed or open.
What do you think?
Developer
May 1, 2009 at 10:30 PM
i have implemented & tested Editor's GridBasedViewer component
Also now it supports
 + to move(scroll area) through the level
 + select objects
 + move objects

You can look on to it any time you want. I have also put some test data to test them....
Developer
May 1, 2009 at 10:48 PM
Edited May 1, 2009 at 10:53 PM
It does not change anything for me...
I am really not good at legality stuff... Not know much about it.

For me the best licence would be :
 + People could attend to this project,
 + They could see our code
 + They could advance our code on their own
 + They could use our engine for their own commercial projects (But they must mail to us and also they must add our logo and legailty stuff to their project, thats all)
 + They could NOT use our game stuff & resources (Meshes, Textures, Scenario etc..) on their commercial projects without permission (I think it is Creative Commons Licence but not sure).

But, I dont know which licence type could afford these..
Coordinator
May 2, 2009 at 3:03 AM
Edited May 2, 2009 at 3:31 AM
I agree with what you want. I would prefer they ask permission to use certain things; and if they make money, I or you could have an option to take percentage. They could always view and use the code though.
The BSD is simple and I could add these clauses to it.

...

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  • (added clause) The user of this code must ask permission to sell or commercially maintain our code. They must also maintain our logos and copyrights somewhere in the code.
...
I still need to ask about the LPGL but I didn't see anything about modified code in there, just binaries and source viewing.
The media could take the Creative Commons license. To me, if some of them are making money for commercial purposes like UTorrent etc, they should ask permission. I always thought those torrents where fine but if they are making millions, I would like a cut.

Developer
May 2, 2009 at 3:31 AM
I also like an extra clause as:
  • These sources can not be used on any evil projects (ex: Server application of DeathStar, Database of Cthulhu Cults, Windows 7, etc...)
I like these types of jokes on licence agreements...
Coordinator
May 2, 2009 at 3:41 AM
I tested the level editor and I really am lovin it. It reminds me of the old school editors. The coolest editor was for a game called Revenant I still have. Interesting tile ones were Arcanums.
Yah I just put that license in SmartMap Core but you can use it if you want to.
Wait I like the Death Star ...just kidding.
That guy made those GPL licenses back when I was in high school and then people started mentioning how Linux was free to download (I was like so what I remember when I could copy anything 10 years ago. I used to copy half of my games in the 1980s. Before that I think sourcecode usually came with the product in the early 1980s.
Coordinator
May 2, 2009 at 3:44 AM
I also have to put this: :-)
(added clause) The user of this code must ask permission to sell or commercially maintain our code. They must also maintain our logos and copyrights somewhere in the code. Unless it is at a garage/home sale.
Developer
May 2, 2009 at 10:42 PM
Revenant was one of the most interesting/very good  arcade/rpg i have ever played... It had got different death types & attack types  for all monsters. (If you press pierce attack to a spider, character was crushing spiders by stepping on them, not made a typical pierce attack) It was very balanced game (it was underrated) since it had many bugs.

I also like arcanum much (the best steam punk rpg ever)

But best rpg i have ever played was Fallout1/Fallout2.

Then the second one was Planescape Torment...

I am a big rpg fan since i have met with computers, many rpg's developed on 1980s & 1990s was a new age of literature & art. But today RPGs lost their spirits and developers start to develop only better graphic and lesser detailed games. I also like reading/writing novels and traditional art, so i feel sad about these i talk about.
Developer
May 2, 2009 at 10:58 PM
Ioncycle can i ask you for something?

If you have time can you investigate how can we create a screenshot of a mesh from top down, fixed distance, ortographic projected camera on Axiom.
I have tried to set camera to ortographic but i failed a few months ago. If you also cant achive that maybe we could report that to Borrilis or Andris11.

I want this for to gain the preview images of meshes automaticaly while we exporting them. Preview images are the images you see on the editor (and map of the game)
Coordinator
May 3, 2009 at 2:30 AM
My favorite CRPG is a weird story. It's Daggerfall but I didnt play it at first, since I bought and used Windows 1995 very quickly and it didnt run well on it. I still havent played it as much as  would like. I dont like Oblivion but still played it.
Daggerfall really had no limitations in story, faction, or world movement capabilites. and their was no "Main Quest" but branching story lines and competing factions. I still would want to exapnd on their ideas allot more though that havn't been done yet like beyond reputaion to logical questing. Next would be the Fallout series and Arcanum or Planetscape. In the 1980s my favorties were adventure games.
I never really played Wasteland I was more into 3d style. I made simple levels from something called DataCad, an early 3D CAD program and then Bards Tale Contruction Set came out and I used that a little.


I think preview images could be good for inventory items too? Sometiems it's even good to have 3D representation I think. I am not sure if Orthographic works or not I havent tested it. Maybe just post it on their forum.
Developer
May 3, 2009 at 12:45 PM
Yeah Daggerfall have astonished me... You can ride horse and horse-charts and an exteremely large world. I have played it about 2-3 years without get bored.
Also you had ability create new custom spells if very skilled on magic, or you had ability to climb even walls if skilled on acrobatics etc.. Also the acoustics of the dungeons and the sounds of monsters was terrifing. Daggerfall is also in my top 5...

We have a similar taste/vision about RPGs...

Also old click-adventure games was masterworks...
I have also played nearly all adventure games between 1989-1999 XD 
My top 10 on Adventures would be :
Sanitarium (i think, the best adventure ever)
The Dig
Grim Fandango
MonkeyIsland Series(especially MI-3)
Full Throttle
DarkSeed I-II
Broken Sword I-II
Gabriel Knight - Beast Within
Leisure Suit Larry - Love for Sail
Bad Mojo

Yeah, preview images are also usefull on inventory, you are right. Can you implement a util application that take a mesh name as argument and create a preview image from it?


Coordinator
May 3, 2009 at 1:09 PM
Edited May 3, 2009 at 1:15 PM
Sure I can try to create an app that can do that.

Check this link out. this is great that they even have Quest for Glory games. Part 3 and 4 were really good. but 5 was really good they don't have it.
Sanitarium. I am downloading now:
http://free-game-downloads.mosw.com/abandonware/pc/adventure/games_sa_so/sanitarium.html
Developer
May 4, 2009 at 12:50 AM
At friday one of my close friends get married. We got drunk from day to night... At Sunday
(today) they called me from my 3DGIS job for overtime work. So i had not implemented anything this weekend

:(


Coordinator
May 4, 2009 at 1:32 AM
Edited May 4, 2009 at 1:34 AM
Sounds like allot. I don't drink latley, just coffe. Overime on Sunday, ouch.
I am modifying QuickGraph right now to handle entrance and exit nodes so we can select logical doors to the mazes. It only takes in exit right now for Root. It's a little limiting right now.
Basically you should be able to have a nice path through the mazes of homes, buildings etc and then we should have NPCs just appear or dissapeer (fade in and out) at points along the maze to do "schedules." They should know how to walk along this path quite intelligently but if running or in flight mode they just might navigate based on simple collision and then go back to their routine when they are in normal mode. They can run from one end of the building to the other though.
The other mazes in the building dont have to be pathnoded just the one that reaches the back and front exits which is already done.
May 5, 2009 at 10:00 PM
Hi friends,

comming here on an evening occasion. Screenshots of a mesh shall be as easy as drinking the cup of coffee :) First, orthographic camera always worked fine, for an entity attached to a scene node at position zero you just need to do

camera.LookAt(Vector3.Zero);
camera.ProjectionType = Projection.Orthographic;
camera.FieldOfView = 200.0f;

the FOV could cause you troubles, because if you wanna to have the mesh full in view, the FOV needs to be the size of the meshe's bounding box, resp. it's largest dimension (the 200.0f would work nicely for the ogrehead.mesh for example). If you have troubles with that, don't hesitate to post to the Axiom forums (so that the world can see where Axiom has it's weaknesses and that those can be corrected :) just derive from TechDemo and implement TechDemo.CreateScene() to provide a testable example).

Where were we? Yet the screenshot, except Alt+Shift+PrintScreen, there's the RenderWindow.WriteContentsToFile( fileName ) method

Haven't read all the thread, hope that helps


May 5, 2009 at 10:53 PM
Am stupid like hell! FOV should be an angle!
Developer
May 6, 2009 at 12:23 AM
Edited May 6, 2009 at 12:24 AM
Yeah i did not understood it when i first read, because FOV must be useless on Ortographic (Since frustum is not a cutted pyramid but a cube)

We are needing this because we try to implement a mesh image saver (for to use on 2D WorldEditor & on Inventory Items). There are another issues like boundary detecting and  make background transparent... Since we are working with grids, we must give a SceneUnit - Pixel equalization and we must make screenshoots the multipliers of our basic grid size (ex : grid size is 2x2 scene units on scenemanager & 64x64 px on imagepreview, so mesh with 3x3 scene unit size must create a : 4x4su = 128x128px sized image. For this camera must be on the same distance on all screenshots ofcourse..)

We must create a scene with no lightling and a full magenta background (255R,0G,255B) (and also no overlays), after take the screenshot,
we can do :

            System.Drawing.Bitmap bmp = System.Drawing.Bitmap.FromFile("screenshot_cache.png");
            bmp.MakeTransparent(Color.Magenta);
            bmp.Save("../RPG_Demo/Media/Browser/" + mesh.Name + ".png", System.Drawing.Imaging.ImageFormat.Png); 
Coordinator
May 6, 2009 at 3:03 AM
Great information guys and also *I guess I will be only using png's and jpg's.
I have to insert the Axiom libraires in OrthoSnapper next and the derive from create scene. I can set up those different console switches.
Coordinator
May 6, 2009 at 4:09 AM
I am going to just link OrthoSnapper to the Smartmap_Core libraries. Obviously that way we can take pictures of the 3d world from there. Getting that terrain and mazes in should be cool.
May 6, 2009 at 11:18 AM
>Yeah i did not understood it when i first read, because FOV must be useless on Ortographic (Since frustum is not a cutted pyramid but a cube)

The matter is that there shall be a way to specify the size of the projection box in orthogonal mode. In a Camera implementation the FOV could be the property to handle that, although the representation of that value would be different for perspective and orthogonal modes. So if that would work as I would intuitively expect, then my first description would be correct though, because the talk is about ortographic camera mode. In Axiom, the FOV *affects* othro rendering results, but there's something wrong anyway. Maybe just the degrees-to-radians conversion when setting the FOV property, that shouldn't be of use with ortho projection. Perhaps am wrong yet, will try to find out more tonight, where I made the assumption that everything should work.
Coordinator
May 6, 2009 at 5:23 PM
Edited May 6, 2009 at 5:24 PM
nowherestudios can you email or IM me. Your IM says you are offline all the time. I need to ask some important questions about the orthographic tool and your editor.
May 6, 2009 at 5:35 PM
So, ortographic camera works in Axiom, anyway in Axiom/OGRE, the FOV doesn't work the way I was describing it above, sorry.

In Axiom/OGRE both the distance of near clipping plane of the camera and the FOV decide what the visible area will be. The formula to calculate the near clipping plane distance from a given FOV and object height should be as follows:

camera.near = (objectHeight * 0.5) / tan(FOV * 0.5);

it's a bit of trigonometry, the FOV angle at observers point, the near clipping plane and it's distance from that point define a triangle. You want to calculate the near clipping plane distance == height of that tri.  If you need that, I can assemble some working example for crickhollow most certainly

May 6, 2009 at 5:38 PM
i.e. with that you can ortho-display an object and make it fit into a given viewport
May 6, 2009 at 6:09 PM
http://img503.imageshack.us/img503/4462/orthoobjectview.jpg

;)
Coordinator
May 6, 2009 at 6:13 PM
Purty. It's a novel approach to just work with 2D.
Developer
May 6, 2009 at 11:04 PM
Ioncycle sorry for i was AFK for a few days. I was preparing another report for master degree.All my university stuff and my overworks at GIS work will end at May 25. Then i will be free like a bird for the summer to focus only on our RPG project.

It is a little hard to see me on IM, because simply we are at very long distances an while its morning there, here is evening or night.
Also i generally does not enter IM if someone particularly request from me. (I dont want to loose time with chatting useless stuff with friends).
But if it is usefull for you, i will open IM but make myself "appear offline". Also you can ask questions from here. I can check this forums more frequently than IM or mail.

Andris can you share your code with us to use on our 2D image preview tool?

Also it seems logical for FOV calculation that you talk about.
It is a triangle calculation to find parallel edge length, from half of fov angle and half height of near plane. Since near & far planes must have equal size to object, we can use half of object height as half of near plane height.
 
Also for ortho-snapper: we need  not an image snapped the size of the object but the multipliers of grid size so we must use object height and width to find minimum multiplier of grid sizes:

I send you a very close to real example, i havent test it. write it on forum here right now ;)

Vector3 objectMin = objectNode.BoundingBox.Min;
Vector3 objectMax = objectNode.BoundingBox.Max;

//From top-down
float objectWidth = objectMax.x - objectMin.x;
float objectLength = objectMax.z - objectMin.z;

float multiplierWidth = Math.Ceil(objectWidth / GRID_WIDTH);
float multiplierLength = Math.Ceil(objectLength / GRID_LENGTH);

camera.near = (GRID_LENGTH * multiplierLength * 0.5) / tan(FOV * 0.5);

//Take screenshot process here...

Bitmap preview = Bitmap.FromFile(""Screenshot.png");
preview.MakeTransparent(Color.Magenta);
preview = ScaleByPercent(preview, (float)preview.Height / (GRID_LENGTH_BY_PIXEL * multiplierLength));
preview = Crop(preview, GRID_WIDTH_BY_PIXEL * multiplierWidth, GRID_LENGTH_BY_PIXEL * multiplierLength, AnchorPosition.Top);
preview.Save(mesh.Name + ".png", ImageFormat.Png);

//This is the ScaleByPercent method
static Image ScaleByPercent(Image imgPhoto, float nPercent)
{
    int sourceWidth = imgPhoto.Width;
    int sourceHeight = imgPhoto.Height;
    int sourceX = 0;
    int sourceY = 0;

    int destX = 0;
    int destY = 0;
    int destWidth  = (int)(sourceWidth * nPercent);
    int destHeight = (int)(sourceHeight * nPercent);

    Bitmap bmPhoto = new Bitmap(destWidth, destHeight,
                             PixelFormat.Format24bppRgb);
    bmPhoto.SetResolution(imgPhoto.HorizontalResolution,
                            imgPhoto.VerticalResolution);

    Graphics grPhoto = Graphics.FromImage(bmPhoto);
    grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic;

    grPhoto.DrawImage(imgPhoto,
        new Rectangle(destX,destY,destWidth,destHeight),
        new Rectangle(sourceX,sourceY,sourceWidth,sourceHeight),
        GraphicsUnit.Pixel);

    grPhoto.Dispose();
    return bmPhoto;
}

//This is the Crop method
static Image Crop(Image imgPhoto, int Width,
                    int Height, AnchorPosition Anchor)
{
    int sourceWidth = imgPhoto.Width;
    int sourceHeight = imgPhoto.Height;
    int sourceX = 0;
    int sourceY = 0;
    int destX = 0;
    int destY = 0;

    float nPercent = 0;
    float nPercentW = 0;
    float nPercentH = 0;

    nPercentW = ((float)Width/(float)sourceWidth);
    nPercentH = ((float)Height/(float)sourceHeight);

    if(nPercentH < nPercentW)
    {
        nPercent = nPercentW;
        switch(Anchor)
        {
            case AnchorPosition.Top:
                destY = 0;
                break;
            case AnchorPosition.Bottom:
                destY = (int)
                    (Height - (sourceHeight * nPercent));
                    break;
            default:
                destY = (int)
                    ((Height - (sourceHeight * nPercent))/2);
                break;
        }
    }
    else
    {
        nPercent = nPercentH;
        switch(Anchor)
        {
            case AnchorPosition.Left:
                destX = 0;
                break;
            case AnchorPosition.Right:
                destX = (int)
                  (Width - (sourceWidth * nPercent));
                break;
            default:
                destX = (int)
                  ((Width - (sourceWidth * nPercent))/2);
                break;
        }
    }

    int destWidth  = (int)(sourceWidth * nPercent);
    int destHeight = (int)(sourceHeight * nPercent);

    Bitmap bmPhoto = new Bitmap(Width,
            Height, PixelFormat.Format24bppRgb);
    bmPhoto.SetResolution(imgPhoto.HorizontalResolution,
            imgPhoto.VerticalResolution);

    Graphics grPhoto = Graphics.FromImage(bmPhoto);
    grPhoto.InterpolationMode =
            InterpolationMode.HighQualityBicubic;

    grPhoto.DrawImage(imgPhoto,
        new Rectangle(destX,destY,destWidth,destHeight),
        new Rectangle(sourceX,sourceY,sourceWidth,sourceHeight),
        GraphicsUnit.Pixel);

    grPhoto.Dispose();
    return bmPhoto;
}



Developer
May 6, 2009 at 11:15 PM
BTW,

you can find
GRID_WIDTH & GRID_LENGTH from
RolePlayingGame.World.GridBased.GridBasedWorld class

and calculate
GRID_WIDTH_BY_PIXEL & GRID_LENGTH_BY_PIXEL from
GRID_WIDTH_BY_PIXEL = GRID_WIDTH * SCENEUNIT_TO_PIXEL_RATIO;
GRID_LENGTH_BY_PIXEL = GRID_LENGTH * SCENEUNIT_TO_PIXEL_RATIO;

May 7, 2009 at 12:40 AM
nowherestudios: you got the FOV / near clipping distance relation right. I played a bit and put a demo together which hopefully explains some more potentional troubles yet, check it from the link.

http://axiom.pastebin.com/f4b78104a

I'm probably going to put that example into Axiom wiki some later. Modifying it so that the rendered mesh doesn't fit the size of the viewport but a portion of it only (grid cell) should be some easy

Coordinator
May 7, 2009 at 2:52 AM
Edited May 7, 2009 at 2:55 AM
nowherestudios. Sounds great. My head is about to spin off on how fast this project has picked up in the last week. :-0 I have so many more things going on too but this is pretty important to me. I haven't even been able to keep up with my website work. I like 'desktop' software better though.

Basically I just wanted to say I have combined OrthoSnapper and SmartMap_Core into one Solution so when you open the OrthoSnapper solution it should allow for the SmartMap_Core project as well.

I hope that's OK, i figure you will need to snap pictures of pre-generated SmartMap mazes etc.
The new SmartMap mazes are looking really nice now. The structures are allot more jagged looking and there should be allot more tweaks to get almost any shape you want later.

Also for some odd reason my svn folders aren't being created on Tortoise->Import for OrthoSnapper. Hasn't worked. :- (
Developer
May 7, 2009 at 10:15 PM
<Basically I just wanted to say I have combined OrthoSnapper and SmartMap_Core into one Solution so when you open the OrthoSnapper solution it should allow for the SmartMap_Core project as well.
I hope that's OK>

Its OK.



Andris thanks for sharing your information.