Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 35

Thread: WFTO by Kopavel

  
  1. #1

    Default WFTO by Kopavel

    BRIEF
    WFTO demo second release. This demo dont follow WFTO design document, but this forum is the only place where it is accessible, so I call it WFTO nevertheless.

    WFTO (Mirror 1) (6.34 MB)
    WFTO (Mirror 2) (6.34 MB)

    PROJECT STATUS
    Undetermined. There are 3 fraweworks related to WFTO.
    The first is IKSLM's NBKE (OpenGL, windows only, with steps toward cross-platformity)
    Second is this one (DirectX, windows only)
    Third one uses Ogre3D (lots of code, I had no time to sort it out for myself)

    I have some plans on implementing entirely new lighting pipeline, this may consume a lot of time. Also, I am planning to use PhysFS to improve loading time and lower disk space requirements. These are just concepts and I am not yet sure I will push this demo much further.

    Sources (MS VS 2005) are attached.

    FEATURES
    Basic dungeon rendering and lighting, with possibility to dig the tiles (I call them blocks).
    LUA integration, currently used for handling dungeon and creature events.
    Basic creature AI (creatures are visualised as animated skinned meshes).
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screen1.jpg 
Views:	160 
Size:	310.5 KB 
ID:	180   Click image for larger version. 

Name:	Screen2.jpg 
Views:	144 
Size:	248.4 KB 
ID:	181   Click image for larger version. 

Name:	Screen3.jpg 
Views:	126 
Size:	233.5 KB 
ID:	182  
    Attached Files Attached Files
    Last edited by Kopavel; February 5th, 2010 at 22:46.

  2. #2

    Default Re: WFTO by Kopavel

    FURTHER DEVELOPMENT
    There's still not much flexibility about it, but you can play with LUA scripts.

    Here is how scripting works:
    Engine imports sets of functions and constants into each LUA script loaded (these sets differ from script to script), as well as common LUA script Common.lua, which contains math functions and proxy functions definitions (for debugging).
    Each script recieves COMBINE_ closure so LUA can understand whether engine is executing script or you are testing it on your own.
    So when you want to execute script apart from engine, you place Common.lua to folder with your script, and thats pretty much it.
    One important C++ function accesible in LUA is trace, which recieves text string and prints in to file lua_debug.txt.

    When you execute script on your own, trace merely transforms into print (standard LUA output function)

    Important: you need a basic understanding of 3D space to write scripts in 2D. DirectX uses left-handed coordinate system (compared to OpenGL's right handed), which means that X axis points to your right, Y axis points up (to the sky), Z axis points away from you.
    In 2D, X axis points right, Y axis points up. When 3D and 2D communicate, X(3D) axis is assumed to point the same way as X(2D), Z(3D) is the same as Y(2D), and Y(3D) is omitted (creatures cant currently move up and down in the dungeon).

    1. Media/Common.lua
    Check it out yourself, I dont think there is something complicated in it.
    Outline: it defines functions to work with tables (structures form C++ are called tables in LUA) of specific type, which I call V2Vec and V3Vec.

    2. Dungeon script
    Media\Dungeon\dungeon_script.lua

    Imported constants:
    DUNGEON_BLOCK_WIDTH
    DUNGEON_BLOCK_HEIGHT

    BLOCK_EMPTY
    BLOCK_WALL
    BLOCK_DIRT

    C++ imported functions:

    CreateDungeon
    parameters:
    int - number of dungeon tiles along x asix (1..128)
    int - number of dungeon tiles along z asix (1..128)

    Note that since most dungeons algorithms are 2D, I use 2D vectors for it, But DirectX uses Y asix to point upwards, so 3D Z axis is 2D Y axis. (X remains the same)

    SetBlockType
    parameters:
    int - block x position
    int - block z position
    int - block type

    Possible block types are:
    BLOCK_DIRT = 0;
    BLOCK_EMPTY = 1;
    BLOCK_WALL = 2;
    , these are defined in LUA (as already stated)

    GetBlockType
    parameters:
    int - block x position
    int - block z position

    return values:
    int - block type

    CreateStaticEntity
    parameters:
    V3Vec - entity position
    V3Vec - entity up direction (normalized vector)
    V3Vec - entity forward direction (normalized vector)
    String - entity mesh file

    CreateCreature
    [to be continued]

    CreateTorch
    [to be continued]

    RemoveEntities
    [to be continued]

    GetEntityClass
    [to be continued]

    GetEntityPosition
    [to be continued]

    LUA functions called from C++:

    OnCreateEntities
    No input or output. Called once, right after dungeon is created. Can be used to define custom level appearance.

    OnBlockChange
    No input or output. Most important function called for each block which type has changed.


    3. Creature AI script
    [you can add new ones]
    Media\Creatures\Orc\orc_script.lua

    Each creature recieves its own instance of LUA script context, so you dont need to mess around with 'this' pointer.

    C++ imported functions:

    SetPosition
    parameters:
    V2Vec - 2D position you want place creature to. X and Y axis are mapped to X and Z axes, respectively.
    return:
    bool - false if cant move creature to that position.

    GetPosition
    return:
    V2Vec - Current 2D position of creature. X and Y axis are mapped to X and Z axes, respectively.

    SetOrientation
    parameters:
    V2Vec - Normalized 2D orientation. X and Y axis are mapped to X and Z axes, respectively.
    return:
    bool - false if cant orient creature that way.

    GetOrientation
    return:
    V2Vec - Normalized 2D orientation. X and Y axis are mapped to X and Z axes, respectively.

    SetAnimation
    parameters:
    string - Name of the animation. Use your own .X files with arbitrary animations.

    FindPath
    parameters:
    V2Vec - where you want the path to start from
    V2Vec - where you want the path to end
    return:
    list of V2Vec - path nodes, each segment of this path is a line .
    note:
    This function is supposed to be implemented in C++. It currently uses proxy LUA implementation. Feel free to extend it.

    LUA functions called from C++:

    OnProcess
    input:
    float - elapsed time since last call
    The only function, which is responsible for all AI logic.

    IMPORTANT NOTE
    This is draft. I'm new to LUA.
    Last edited by Kopavel; January 25th, 2010 at 20:17.

  3. #3

    Default Re: WFTO by Kopavel

    SOFTWARE

    LUA
    I used package http://luaforwindows.luaforge.net/index.html#Download
    Which contains LUA IDE called SciTE, which I liked very much!

    DirectX
    Mesh models could be created in any editor (I use 3DSMax 9), but for them to be used by the framework, they need to be converted to DirectX' .X file format.
    I used Pandasoft DirectX exporter for 3DSMax 9.
    Last edited by Kopavel; January 25th, 2010 at 20:07.

  4. #4

    Default Re: WFTO by Kopavel

    [reserved for future posting]

  5. #5

    Default Re: WFTO by Kopavel

    Looking amazing

  6. #6
    Imp Exception's Avatar
    Join Date
    Jan 2010
    Location
    South Africa
    Posts
    20

    Default Re: WFTO by Kopavel

    Looks great, and thanks for the great effort in making some documentation. I was planning to go to bed now, but seems I will be spending some time looking over the source first.

  7. #7

    Default Re: WFTO by Kopavel

    to compile:
    Install latest Havok and Lua SDKs, and add to solution:
    http://software.intel.com/sites/havo...l_20090704.zip
    http://luaforwindows.googlecode.com/..._v5.1.4-30.exe

    Install Kopavel's demo and copy the contents of the Media folder into your solution directory.


    Release + Debug tested and working under VS2008.

    Kopavel, can you host this project at github.com? I would love to start making modifications but would prefer to branch from the original version.

  8. #8
    Demon Spawn
    Join Date
    Sep 2009
    Location
    Germany
    Posts
    188

    Default Re: WFTO by Kopavel

    Quote Originally Posted by Kopavel View Post
    Undetermined. There are 3 fraweworks related to WFTO.
    The first is IKSLM's NBKE (OpenGL, windows only, with steps toward cross-platformity)
    just wondering, why doesn't it use SFML for platform-independent window creation and input handling? It's quite neat and simple.

  9. #9
    Imp
    Join Date
    Nov 2009
    Location
    Germany
    Posts
    9

    Default Re: WFTO by Kopavel

    Hey Kopavel,

    thanks for sharing your work. It looks amazing.
    Just have two questions:
    - In your older screenshots there was information about frame rate and usage of GPU memory. Is there any option to turn that on?
    I run on a Geforce 8400M with 1024x768 in Fullscreen mode and it worked sometimes a bit slow, so I was just wondering about the frame rate.
    - you citate that there is an Ogre3D project working on that too. Could you give any link about that?

    Bye Simon
    Last edited by SimFirehawk; January 26th, 2010 at 10:29.

  10. #10

    Default Re: WFTO by Kopavel

    Quote Originally Posted by drkow View Post
    to compile:
    ...
    Thanks, I forgot to mention it. Actually, I have Media/ folder with all the art placed in a different location (compared to source codes) on my home PC. However, I commented the code that includes additional directories from this release, so you have to place it there, yes.
    Also, I experience huge problems switching from Release to Debug modes because of Havok - thats the reason you may experience problems compiling it as well.

    Quote Originally Posted by drkow View Post
    to compile:
    Kopavel, can you host this project at github.com? I would love to start making modifications but would prefer to branch from the original version.
    If you'd really like to make modifications, I need some time to refactor the code, and mark the code that is stable and should not be modified, as well as code that is experimental (thats like 30% of code).
    Anyway, a better way to contribute would be not to modify this one, but rather work on a tool set that would allow people to create content. This tools could be a plugin for 3D editor or a middleware solution (like Ogre3D).

Similar Threads

  1. WFTO 0.2 Preview
    By dotted in forum War for the Overworld
    Replies: 48
    Last Post: April 23rd, 2010, 07:31
  2. WFTO Release 0.1b Information
    By Simburgur in forum War for the Overworld
    Replies: 92
    Last Post: March 27th, 2010, 22:34

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •