Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

136 Neutral

About Warvstar

  • Rank

Personal Information

  • Interests
  1. Hey guys, I'm currently using Squirrel as a scripting solution for my game engine, I'm using Sqrat for binding, at least for now. [color="#333333"][font="arial, helvetica,"] [/font] [color="#333333"][font="arial, helvetica,"]Heres my code so far [color="#000000"]void BindSquirrel(HSQUIRRELVM vm) { using namespace Sqrat; Class<TreeView> myTV(vm); myTV.Func("init", &TreeView::InitTreeView); myTV.Func("addItem", &TreeView::addItem); myTV.Func("setPosition", &TreeView::SetScreenPosition); myTV.Func("setScale", &TreeView::setScale); myTV.Func("render", &TreeView::Render); //myTV.Var("getRoot", &TreeView::root); // Does not work myTV.Prop("getRoot", &TreeView::getRoot); // Does not work RootTable(vm).Bind("TreeView",myTV); RootTable().Bind("TreeItem", Class<TreeItem>() .Func("init", &TreeItem::InitTreeItem) .Func("setPosition", &TreeItem::SetScreenPosition) }; run_script("tv <- TreeView();"); // Works fine run_script("root <- tv.getRoot();"); //Works fine here } [color="#333333"][font="arial, helvetica,"][color="#000000"]void BindSquirrel(HSQUIRRELVM vm) { using namespace Sqrat; Class<TreeView> myTV(vm); myTV.Func("init", &TreeView::InitTreeView); myTV.Func("addItem", &TreeView::addItem); myTV.Func("setPosition", &TreeView::SetScreenPosition); myTV.Func("setScale", &TreeView::setScale); myTV.Func("render", &TreeView::Render); //myTV.Var("getRoot", &TreeView::root); // Does not work myTV.Prop("getRoot", &TreeView::getRoot); // Does not work RootTable(vm).Bind("TreeView",myTV); initTreeItem(); <div> </div> run_script("root <- tv.getRoot();"); //Does not work here //It calls TreeItem* TreeView::getRoot() {return root;}on return it causes exception, below I describe where } void initTreeItem() { RootTable().Bind("TreeItem", Class<TreeItem>() .Func("init", &TreeItem::InitTreeItem) .Func("setPosition", &TreeItem::SetScreenPosition) }; } [/font] [color=#333333] [color="#333333"][color=#333333]when I try and run_script outside of the function the class<TreeView> was defined in, I get an error in sqratClassType.h at [color="#000000"][color=#333333]static void PushInstance(HSQUIRRELVM vm, C* ptr) { sq_pushobject(vm, ClassObject(vm)); // HERE,initialized = false sq_createinstance(vm, -1); sq_remove(vm, -2); sq_setinstanceup(vm, -1, ptr); } [color="#333333"][color=#333333]so whats causing this to happen? Anyone know? [color="#333333"][color=#333333]edit: heres what happens at[color="#000000"][color=#333333]static inline HSQOBJECT& ClassObject(HSQUIRRELVM vm) { return getClassTypeData(vm).classObj; } [color="#333333"][color=#333333]when run_script is called outside function that Sqrat::Class<TreeView> was defined in, or in onUpdate(). Sqrat::TreeItem>::getClassTypeData returned {initialized=false classObj={...} getTable={...} ...} Sqrat::ClassTypeData & [color=#333333] [/font]
  2. http://wiki.squirrel-lang.org/default.aspx/SquirrelWiki/Squirrel_JIT.html There are some commercial games that use Squirrel as there scripting interface, http://en.wikipedia.org/wiki/Squirrel_(programming_language) Personally, I have Lua script in my engine right now, but I'm going to try out Squirrel.
  3. Warvstar

    Thoughts on voxels?

    I use voxels on both the CPU and GPU in many different ways and they all perform well. Check out these sites / papers Volume Rendering Tutorial http://www.vis.uni-stuttgart.de/vis03_tutorial/ Real-Time Programmable Volume Rendering Beyond triangles: gigavoxels effects in video games Efficient sparse voxel octrees also Marching Cubes High-speed Marching Cubes using Histogram Pyramids Tons of research still been done in this area.
  4. Warvstar

    Should I learn assblem ?

    Assembly can come in handy, you will know when you need it. I wouldn't worry about it right now.
  5. Warvstar

    which one to use?

    I've used Torque on some commercial products. Now I'm using my own engine, if I were to pick out of the list you have, I would pick UDK. edit: and UDK tutorials can be found on udk.com if I remember correctly. Also try this http://forums.epicgames.com/showthread.php?t=707152
  6. Warvstar

    Online Games

    What sort of server are you planning on hosting it on? Will this card game be 2d? Are you planning on having lots of people play this game? Do you want to design using a visual editor? Are you willing to learn a new language? Answer these questions and I can help you narrow dome some languages / services.
  7. Lighting, thats a big reason there.
  8. Hey all, just wondering if anyone could help me out with this. Right now I have it so if Vec3f returned is not null then it increases the size of the mesh. I'm getting weird results with it at the moment. I have two meshes, one at 0,0,0 and the other at 100,100,100. Camera is at 200, 100, 1000 and is viewing top down. I would appreciate any help, thanks! Vec3f D3DRenderer::Pick(Matrix* World, const VertexS* vertexbuffer, const int* indexbuffer, Vec3f screenpos, RenderJob* renderJob ) { HRESULT hr; D3DXVECTOR3 rayObjOrigin,rayObjDirection; D3DVertexBuffer *pVB = (D3DVertexBuffer*)m_pRenderObjectFactory->GetRenderObject(renderJob->GetVertexBufferID()); D3DIndexBuffer *pIB = (D3DIndexBuffer*) m_pRenderObjectFactory->GetRenderObject(renderJob->GetIndexBufferID()); int vc = pVB->GetNumOfVertices(); int indicec = pIB->GetNumOfIndices(); unsigned int i[36]; std::vector<VertexS*> Vert = pVB->GetSimple(); const uint32** Index = pIB->GetIndices(); for (int pp = 0; pp < indicec; pp++) { i[pp] = *Index[pp]; } vertex vv1[8]; for (int p = 0; p < vc; p++) { vv1 = vertex(D3DXVECTOR3( Vert->position.x, Vert->position.y, Vert->position.z ), D3DXVECTOR4( Vert->color.x, Vert->color.y, Vert->color.z, 1 )); } //const DXGI_SURFACE_DESC* pd3dsdBackBuffer = DXUTGetDXGIBackBufferSurfaceDesc(); bool g_bAllHits = false; g_nNumIntersections = 0L; POINT ptCursor; GetCursorPos( &ptCursor ); ScreenToClient( this->m_hWnd, &ptCursor ); // Compute the vector of the pick ray in screen space D3DXVECTOR3 v; v.x = ptCursor.x;//screenpos.x; v.y = ptCursor.y;//screenpos.y; v.z = 1.0f; v.x = ( ( ( 2.0f * ptCursor.x ) / 640.0f ) - 1 ) / m_ProjMatrix._11; v.y = -( ( ( 2.0f * ptCursor.y ) / 480.0f ) - 1 ) / m_ProjMatrix._22; v.z = 1.0f; // Get the inverse view matrix D3DXMATRIX matWorld; matWorld._11 = World->_ms._11; matWorld._12 = World->_ms._12; matWorld._13 = World->_ms._13; matWorld._14 = World->_ms._14; matWorld._21 = World->_ms._21; matWorld._22 = World->_ms._22; matWorld._23 = World->_ms._23; matWorld._24 = World->_ms._24; matWorld._31 = World->_ms._31; matWorld._32 = World->_ms._32; matWorld._33 = World->_ms._33; matWorld._34 = World->_ms._34; matWorld._41 = World->_ms._41; matWorld._42 = World->_ms._42; matWorld._43 = World->_ms._43; matWorld._44 = World->_ms._44; D3DXMATRIX* m_WorldMatrix = new D3DXMATRIX;; m_WorldMatrix = &matWorld; //D3DXMatrixInverse(m_WorldMatrix, NULL, &m_ViewMatrix); //D3DXMatrixIdentity(m_WorldMatrix); D3DXVECTOR3* result2 = new D3DXVECTOR3; //D3DXVec3Unproject(result2, &v, &this->viewPort, &m_ProjMatrix, &m_ViewMatrix, m_WorldMatrix ); vPickRayDir.x = result2->x; vPickRayDir.y = result2->y; vPickRayDir.z = result2->z; D3DXMATRIX m; D3DXMatrixInverse( &m, NULL, &m_ViewMatrix ); vPickRayDir.x = v.x*m._11 + v.y*m._21 + v.z*m._31; vPickRayDir.y = v.x*m._12 + v.y*m._22 + v.z*m._32; vPickRayDir.z = v.x*m._13 + v.y*m._23 + v.z*m._33; D3DXVec3Normalize(&vPickRayDir,&vPickRayDir); vPickRayOrig.x = m._41; vPickRayOrig.y = m._42; vPickRayOrig.z = m._43; vPickRayOrig+=vPickRayDir*1.0f; D3DXMATRIX m_worldMat; D3DXMATRIX m_combinedMat; D3DXMatrixIdentity(&m_worldMat); D3DXMatrixMultiply(&m_combinedMat,&m_ObjectWorld,&m_ViewMatrix); D3DXVECTOR3 vNear,vDir; D3DXMATRIX invMat; D3DXMatrixInverse(&invMat,NULL,&m_combinedMat); D3DXVec3TransformCoord(&vNear,&vPickRayOrig,&invMat); D3DXVec3TransformNormal(&vDir,&vPickRayDir,&invMat); UINT nFace; FLOAT fBary1, fBary2, fDist; UINT nHitCount = 0; ID3DX10Mesh* qMesh; D3DX10CreateMesh( m_lpD3DDevice, vertexInputLayout, 2, vertexInputLayout[0].SemanticName, vc, indicec / 3, D3DX10_MESH_32_BIT, &qMesh); qMesh->SetVertexData(0, vv1); qMesh->SetIndexData(i, indicec); qMesh->CommitToDevice(); qMesh->Intersect( &vNear, &vDir, &nHitCount, &nFace, &fBary1, &fBary2, &fDist, NULL); if( nHitCount > 0 ) { return Vec3f(vDir.x,vDir.y,vDir.z); } DWORD dwNumFaces = 36/3; for( DWORD p = 0; p < dwNumFaces; p++ ) { D3DXVECTOR3 v0 = vv1[i[3 * p + 0]].pos; D3DXVECTOR3 v1 = vv1[i[3 * p + 1]].pos; D3DXVECTOR3 v2 = vv1[i[3 * p + 2]].pos; if( IntersectTriangle( Vec3f(vNear.x, vNear.y, vNear.z), Vec3f(vDir.x, vDir.y, vDir.z), Vec3f(v0.x, v0.y, v0.z), Vec3f(v1.x, v1.y, v1.z), Vec3f(v2.x, v2.y, v2.z), &fDist, &fBary1, &fBary2 ) ) { return Vec3f(vDir.x,vDir.y,vDir.z); } } return Vec3f(0,0,0); }
  9. Warvstar

    Starting a new engine

    Thanks Mike and Janta also Thanks Rob, I will look into those. I will keep gamedev.net updated on my progress.
  10. Warvstar

    Starting a new engine

    Thanks for the replies, I'm still deciding what I want to use for scripting though. I can't seem to find any good scripting engines for C#, LUA apparently does not work nicely with C#. Crysis looks amazing btw.
  11. Warvstar

    Starting a new engine

    Thanks for the replies so far, I'm thinking of using raknet for the network. I want to create a scene editor once I get a simple scene graph working nicely. I already know how to create the scene graph, and to move objects around, I even know how to create the scene editor used to create/move objects. What I don't know is how much(or what) I should be letting the PhysX engine handle, from what I understand PhysX can create actors and load meshes, however I was thinking that instead of letting PhysX handle the scenegraph in such a way, that my game engine would handle it, I'm not sure if I'm making sense, here are some examples of what I mean. Ok so my question mainly is, should I code the game like this, Player clicks on the terrain and units moves there, all handled by the engine Actor is created in the scene graph and the move function coded in the engine. or like this, Player clicks on the terrain and units moves there, the actor is created by PhysX and the movement is handled by PhysX, so basically all my engine would be is a graphic engine..? This might be more of a PhysX related question than anything, I will look at how Irrlicht integrated PhysX and see how that works.
  12. Ok so I have been working on a game for the last two years in Torque. I decided recently that although Torque was great, I wanted to build my own game engine, so here is what I to do with the engine. I want to build the engine on C#(new to me). I want to eventually use a DirectX 10 version of XNA, but for now I will be using MDX. This game will be released late 2007 or early 2008, and so I'm hoping XNA in DX10 form will be released. Now a tough decision was deciding what physics to use, will PhysX or HavocFX be dominate next year? I decided to use PhysX because they allow free use of the SDK at development stage, and for good if the game uses the hardware. So right now I'm writing the graphics engine in C# MDX and I want to optimize the engine to use multiple threads(ie. physics/AI), How should the engine design look? I was thinking something like this, Graphics Engine- has a scenegraph, can do stuff like Robot newRobot1 = new Robot(_device, @"robot.x", new Vector3(0.0f, 20.0f, 100.0f), 1f, 10.0f, fireSound, moveSound); newRobot1.position(2, 4, 0); // I think this is directX to move mesh to position newRobot1.setmovedest(2, 2, 0); // This would be my own function to walk the robot to his destination, it would move the robot object, not just its mesh basically add simple collision in here too Now how about physics, how would this work with my graphics engine? Does anyone know how(or the best way?) someone might implement PhysX into a new game engine? Thanks for any help. also I'm comfortable using C++ and unmanaged directX, would it be better for me to stick with C++ and then use DirectX10?
  13. You are a little slow. It is not in the works it is released. Microsoft is letting Indies write games for the Xbox360. You havent even seen my game, so you would not know if Microsoft would want it. Also I have family who work for Microsoft, even I have worked for them in the past, now I mainly work on simulators for the U.S. Army. Yes I have proof of that too.
  14. Here is proof of TSE running on Xbox360, it sells through Live Arcade. http://www.xboxcircle.com/portal/content/view/697/1/
  15. Ok I should probrally remove those screenshots, in reality I dont even use TGE, those shots are very very old(about a year). I use TSE, and yes it works on my Xbox360 so do other TSE games. STHU and wait for me to release the video. Everything on my forums are true and make for a good game, it is only the art that is standard TGE art and like I said a year old. I have been working mainly on core technology, stuff that you will see in my video.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!