tag:blogger.com,1999:blog-53595222880909770522024-03-19T21:31:56.503-07:00Dev HobbyEugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-5359522288090977052.post-27848321064619886632009-12-05T22:33:00.000-08:002009-12-05T22:51:05.403-08:00Holiday codingWith the exams over, I finally have a bit of time to put into Thousand Parsec, at least until January :) After a conversation with mithro, I've decided to set the following goals:<div><ul><li>The wxwidgets client now has a single-player mode built in, which can be ported into the 3d client.</li><li>The client uses version 3 of the thousand parsec protocol (tp03), whereas the current servers already support a new version (tp04). Upgrading the protocol used will allow us to deprecate the old one.</li><li>tp04 comes with some new features, such as media server support. This means that various media such as 3d models, music, icons and such related to a specific game can be downloaded from a server, instead of being packaged with the base client.</li></ul><div>I'd love to add "write a build process for Windows, Linux and Mac binaries" to the list, but it's proved to be a huge timesink in the past and I'd like to concentrate on getting the functionality right first.</div></div>Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com3tag:blogger.com,1999:blog-5359522288090977052.post-28235903816312338392008-09-04T08:23:00.000-07:002008-09-04T09:54:02.161-07:00A quick update, just to break the silenceI've posted a new Windows <a href="http://www.thousandparsec.net/~jmtan/">build</a>, and am currently trying to get the client to work fully with the <a href="http://groups.google.com/group/python-ogre-developers/browse_thread/thread/919f11aa78615fce?hl=en">python-ogre deb</a> on Ubuntu. As expected, getting python-ogre to work on Mac is quite a chore, I'm almost there, got everything compiled but running the demos gives me a <a href="http://groups.google.com/group/python-ogre-developers/browse_thread/thread/3ada3eadf587320b?hl=en">"wrapper" error</a>, and I'll probably have to understand how the code generation in python-ogre works to figure it out.<div><br /><div>Packaging issues aside, I've made a few updates to the client. The lines in the screen represent "Wormholes", which are basically routes between star systems. Currently, only the <a href="http://www.thousandparsec.net/wiki/Risk">Risk</a> ruleset uses this feature, so lines won't display anywhere else, such as on the demo1.thousandparsec.net server which usually runs Minisec.</div><div><div style="text-align: center;"><br /></div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjub6m64EycEKozaNWLLfN3jgOsCJMvWnMeoViVfGcZeI9J4336sxo3Uc-8I5tw9PQ0UnkV75gL0eHHVEYGs9g429Iy0DSENW0Y5FA2-ERZzyrVj6GA1im74E32ZnitoWi1pW00yO1UU3Qa/s400/screenshot.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" border="0" alt="" id="BLOGGER_PHOTO_ID_5242199625503847810" /></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2Ay3Yl9pOwyDlFMP1-Iggz5lT_mu196VMLL9maQ8-IwnoAEyjxtO8mOtoHsLdd_6lJfazza9MfzzW1rEYm87nMGcTMxlQcPJDam-LYQjNrvewp4hjKPkVyuv7EaGmgrryM5h7Targ8vg-/s400/screenshot_2.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" border="0" alt="" id="BLOGGER_PHOTO_ID_5242199627054866370" /></div><div>I've also tweaked the "Information" window to show more useful information such as the planetary resources (I tested it with the "Armies" resource in Risk). In general, I'm trying to locate more crashes by testing the client with different systems and python-ogre builds. OgreAL has been a little problematic, and it's one of the things which I am trying to get working with the linux python-ogre deb file.</div><div><br /></div><div>My main concern about the client is the performance on older hardware. Mithro informed me that even the login screen runs at a crawl on his laptop, which is probably due to the large textures used in the skybox (1024x1024). I guess a solution to this would be to offer a lower-resolution skybox thats selectable from the options menu.</div><div><br /></div><div>I've started my industrial attachment, so I'm pretty much limited to weekends. Nevertheless, I'll be continuing to update the client, and when <a href="http://www.thousandparsec.net/wiki/TP04">tp04</a> support has been added content management will be a lot more elegant, allowing "media" tags which mean no more hardcoded graphics. Another thing I'm looking forward to is more battlexml support in the servers. On my end, I also hope to include some shaders to give game objects a more realistic look, but there are still many things to work out before I have time for that.<br /></div><div><br /></div><div>P.S. If you zoom in on the pictures it kinda looks like those old VGA games.</div><div><br /></div></div><br /><table style="width:auto;"><tr><td><a href="http://picasaweb.google.com/lh/photo/PwfvaN0lXHu4I1wlExgrXQ?authkey=4OUN4uKKegM"><img src="http://lh3.ggpht.com/jmingtan/SMARIvRAfyI/AAAAAAAAAOo/dOu4xp8uGMY/s800/vga.png" /></a></td></tr><tr><td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/jmingtan/DevHobby?authkey=4OUN4uKKegM">Dev Hobby</a></td></tr></table>Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com3tag:blogger.com,1999:blog-5359522288090977052.post-40123819809763287772008-08-17T09:43:00.000-07:002008-08-17T11:22:24.148-07:00Configuration optionsThis is the last week of GSOC, the date in which our evaluations begin is tomorrow. It's been a pretty short and exciting trip, sometimes I'm still amazed that I have the chance to work on this at all. On to the additions!<br /><br />A checkbox for "saving details" was added to the login screen. When checked, the username, password, last server connected to and some other preferences are saved in the user's home directory, so that reinstalling the client will not affect the preferences. The password text is masked now, and saved to disk in hexadecimal format. Pretty primitive, but the idea is just to prevent casual lookers from getting the password.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbpsDAWXqhOKiw7kiQTNWai6lTC0Aq2JD3StdkYxM7jXI2SnOUzQvO3QF18ka86pxvEZvXr60RvKCvELTow97hJHHV1urh0dcnUgVSF5Bz-LSjoXMImJKzTByBOCF1YNYAVqhkgSIyR9x/s1600-h/login.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbbpsDAWXqhOKiw7kiQTNWai6lTC0Aq2JD3StdkYxM7jXI2SnOUzQvO3QF18ka86pxvEZvXr60RvKCvELTow97hJHHV1urh0dcnUgVSF5Bz-LSjoXMImJKzTByBOCF1YNYAVqhkgSIyR9x/s400/login.png" alt="" id="BLOGGER_PHOTO_ID_5235529123319496082" border="0" /></a><br />The configuration dialog was expanded with a couple more options as well as two additional dialog boxes for graphics and sound configuration. The main dialog now has the option to tweak the zooming speed, as well as to adjust the distance scaling. This is meant to help deal with the variety of rulesets which use different units of distance for their maps. The distance unit ratio makes stars further apart the lower it goes, as all distances will be divided by this value when starting a new map.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRQUs37vrLDfZ2OBUPvfPSoxl0bsRhF6__E6rdfYFA0NMnVKhZ2yQRGhERzAUsQUXjCrjr0A1sKVKpgWxkggigXsbNHCGjD2PJb1XYObHxuS3eKXP0EVPAOAhIAnNcSREdBQq1Ia4exgXp/s1600-h/main_prefs.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRQUs37vrLDfZ2OBUPvfPSoxl0bsRhF6__E6rdfYFA0NMnVKhZ2yQRGhERzAUsQUXjCrjr0A1sKVKpgWxkggigXsbNHCGjD2PJb1XYObHxuS3eKXP0EVPAOAhIAnNcSREdBQq1Ia4exgXp/s400/main_prefs.png" alt="" id="BLOGGER_PHOTO_ID_5235531416130965794" border="0" /></a>Graphics options allows the player to change the renderer (although I recommend Direct3D for Windows), resolution and anti-aliasing options. Unfortunately, only the full-screen option works instantly, the rest take place after a restart as only full-screen had a convenient setFullScreen() method which I could use :). Also, each renderer (opengl or direct3d) takes in different values as their configuration. For instance, direct3d takes in resolution and colour depth as a single string, while opengl takes in resolution and colour as different parameters, which means that the user should change the either the renderer alone or the other options without changing the renderer.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUS2v3AbNAe_opy6KAwP2u1DmHIQKTdt3o9ZHKRdQjeQj3SRcOGeu1ktYSChCkqPuS2bUpwulRBdD8d5YI87RMpC0Smg5CYpKRW8f9DHl_L2bi6enz7Kjv3I295CdDKQW8PoXPuoEHDSaJ/s1600-h/graphics_prefs.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUS2v3AbNAe_opy6KAwP2u1DmHIQKTdt3o9ZHKRdQjeQj3SRcOGeu1ktYSChCkqPuS2bUpwulRBdD8d5YI87RMpC0Smg5CYpKRW8f9DHl_L2bi6enz7Kjv3I295CdDKQW8PoXPuoEHDSaJ/s400/graphics_prefs.png" alt="" id="BLOGGER_PHOTO_ID_5235531663750907090" border="0" /></a>For sound, the options are pretty basic (I know it is missing a volume control :)). Setting the driver to other values provided by openal (other than the default 'Generic Software' option) doesn't work for my system, perhaps because I am using on-board sound and not an actual sound card.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikJYPyPuuD8gu12WigbJY4hPOeAXqg3H8hfgq3mMm7n9j9qyq9adl239RKjmc-PfR2kIrwZgWFQqOZgBIqNkDyFzc9a_raiIOK1BZuvJsqjLDmUwaRWFGgRS8XKELVNtXbxsz95-tqH2HB/s1600-h/sound_prefs.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikJYPyPuuD8gu12WigbJY4hPOeAXqg3H8hfgq3mMm7n9j9qyq9adl239RKjmc-PfR2kIrwZgWFQqOZgBIqNkDyFzc9a_raiIOK1BZuvJsqjLDmUwaRWFGgRS8XKELVNtXbxsz95-tqH2HB/s400/sound_prefs.png" alt="" id="BLOGGER_PHOTO_ID_5235531670538574754" border="0" /></a><br />Some work was done to allow the client to adapt better to different rulesets. The map centers properly now (I had a dumb bug where I should be reading x and y values, but instead read both values from x). Zoom distance, which is like the 'step size' for zooming, takes into account the distance scale so that larger maps will not take forever to zoom in. Panning takes into account the current zoom level, so it zooms more when zoomed out. Also, a map boundary was added so that the user will not move out of bounds and get lost, although I'm wondering whether this is a good idea as it sometimes results in apparent 'locking' when the camera runs up against the invisible walls. Perhaps the camera could slide along the walls instead, so that the user can still move about smoothly.<br /><br />One issue with having an adjustable distance scale is that for large distances, the background of stars (which was a particle system) would have to be expanded to encompass everything, thus resulting in a sparser starfield. Although I like the idea of generating the starfield at runtime, increasing the number of stars would have made performance even slower than it already is, so I made a skybox in blender instead. This skybox also replaced the one in the login screen, as it is from the default ogre media - something I am trying to move away from.<br /><br />The following shot shows a camera placed inside a sphere, with it's field of view set to 90 degrees. The starry texture was done by blender's built-in texture generators: some noise, clouds and playing with layer settings. After that, I rendered a screenshot in every direction and set it as a skybox. Easy to do, but getting good settings for the texture is hard, I haven't really figured it out yet.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6EC1eU14UQwuHYf3a81TYcQx2KewXpS4M0U6vUTwuo3MCxOqEG4Dt6naD-r2Man_E46EfQWMRgt49kbzE-sOJhIvvIjMYhMV7rs8zRqJy9YByYIunyWvpNQ2Ahg7-FkxUnYeclhwI3RK9/s1600-h/skybox.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6EC1eU14UQwuHYf3a81TYcQx2KewXpS4M0U6vUTwuo3MCxOqEG4Dt6naD-r2Man_E46EfQWMRgt49kbzE-sOJhIvvIjMYhMV7rs8zRqJy9YByYIunyWvpNQ2Ahg7-FkxUnYeclhwI3RK9/s400/skybox.png" alt="" id="BLOGGER_PHOTO_ID_5235550702458942130" border="0" /></a><br />The next shot shows the starmap with the skybox in use. Sadly, my computer chugs pretty slowly in this server with 34 players. I believe it's the overlay placement code that's the problem as the polygon-heavy models should have been hidden already.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD5nez8MZL_tfELocO-BEapO3vGxLLNHexKGWLdnhjskRHzpqH383JfYP-c_Sv3Jn2YqP3B-UDK4nXe_gqV68LOIfnInhMeaQGhDuznJGgxqqBYFd6HbZrVdK5yxfQCjMQSwRdcQ_eoYzd/s1600-h/starmap.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD5nez8MZL_tfELocO-BEapO3vGxLLNHexKGWLdnhjskRHzpqH383JfYP-c_Sv3Jn2YqP3B-UDK4nXe_gqV68LOIfnInhMeaQGhDuznJGgxqqBYFd6HbZrVdK5yxfQCjMQSwRdcQ_eoYzd/s400/starmap.png" alt="" id="BLOGGER_PHOTO_ID_5235531670916316578" border="0" /></a><br />To end on a high note, I received a nice package this weekend, courtesy of the lead dev mithro. Thank you very much! This made my weekend (well that and Singapore winning it's first Olympic medal in decades, woohoo!)<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8ZoJ7f7vPet0Z8oRLR3hHMan8wkoBgrf5wOsR1z7icQlr8kXPaNFDbHAedV7RTIgR4ILo1AUKCYWanI5haZGSOrU5OZe30WrqQLlSVVGr7YJvfeOvAS9FuxUzBgx1i3fLGbre3vFvbNG-/s1600-h/IMG_0923.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8ZoJ7f7vPet0Z8oRLR3hHMan8wkoBgrf5wOsR1z7icQlr8kXPaNFDbHAedV7RTIgR4ILo1AUKCYWanI5haZGSOrU5OZe30WrqQLlSVVGr7YJvfeOvAS9FuxUzBgx1i3fLGbre3vFvbNG-/s400/IMG_0923.JPG" alt="" id="BLOGGER_PHOTO_ID_5235532179409853106" border="0" /></a>Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-81228839745755581362008-08-10T11:09:00.000-07:002008-08-10T11:45:09.114-07:00Interface additionsI adjusted my priorities a little this week, due to the sudden realisation that GSOC is drawing to a close.<br /><br />Firstly, I added a logo to the main menu.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf9dPY79gO62S3vH-Lj67w5KCbMU1B_EmfkUorUhDMIr9EWmaLc9zzlQRP4UCeHgMSx4QNKDWqhApB2l8KvY7k9UV7XEf4GO5dYVc0UHiZRDlC755fV2yom8ndNHGzjEBfaOQL1bD2vCgn/s1600-h/logo.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf9dPY79gO62S3vH-Lj67w5KCbMU1B_EmfkUorUhDMIr9EWmaLc9zzlQRP4UCeHgMSx4QNKDWqhApB2l8KvY7k9UV7XEf4GO5dYVc0UHiZRDlC755fV2yom8ndNHGzjEBfaOQL1bD2vCgn/s400/logo.png" alt="" id="BLOGGER_PHOTO_ID_5232954210274195314" border="0" /></a>The logo was taken from the <a href="http://www.thousandparsec.net/tp/img/logo_t.png">Thousand Parsec</a> website and put into a CEGUI <a href="http://www.cegui.org.uk/api_reference/classCEGUI_1_1Imageset.html">ImageSet</a>, which is the combination of an image file and an xml file which defines the pixel locations of all images within the set. Right now, it is rather empty:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMmMbg34RyyDdV1Gtsflsv4NKr1nm8KD50EjwNtsFmCwCLuZJRPJVNCY8GlZ7wAwAL4XSIdKOs8m0Hxez-XOCVhkcmldIbaVb35DZPV68hFnSnA5LsCcKXcm-jy4UnUq8liB8TSu19P2fA/s1600-h/tp.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMmMbg34RyyDdV1Gtsflsv4NKr1nm8KD50EjwNtsFmCwCLuZJRPJVNCY8GlZ7wAwAL4XSIdKOs8m0Hxez-XOCVhkcmldIbaVb35DZPV68hFnSnA5LsCcKXcm-jy4UnUq8liB8TSu19P2fA/s400/tp.png" alt="" id="BLOGGER_PHOTO_ID_5232955549378982770" border="0" /></a><br />I hope to fill it up with a lot more icons and image elements to add more spice to the interface.<br /><br />Next, I added a map navigation panel to the lower right of the screen.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzZrb2IYqwNHZgr9VIhfLniR62n3Ww3ZnzGGMjN1itYZ27XasulTQUUOJoD5ymN1zDn6w1d2XMAwfy7G8WKTcXMrcR2eGzWh6Z5KSQM366m3oX-T4hFkbDOmeGwaS_BW7TiRNDzP67hXvm/s1600-h/navigation.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzZrb2IYqwNHZgr9VIhfLniR62n3Ww3ZnzGGMjN1itYZ27XasulTQUUOJoD5ymN1zDn6w1d2XMAwfy7G8WKTcXMrcR2eGzWh6Z5KSQM366m3oX-T4hFkbDOmeGwaS_BW7TiRNDzP67hXvm/s400/navigation.png" alt="" id="BLOGGER_PHOTO_ID_5232956568583103986" border="0" /></a>The functions of the buttons from top to bottom are zoom in, zoom out, deselect, focus on object and fit map to screen (although the last two buttons are indistinguishable at this size, one points inwards and the other outwards). The icons may be familiar already, as they come from the famous <a href="http://www.famfamfam.com/lab/icons/silk/">famfamfam</a> silk icon set. I tried creating my own icons at first, but some creations should never see the light of day. With this, there will be a lot less reliance on keyboard shortcuts, hopefully making the client easier to use. The zoom buttons move in larger steps than the mousewheel zoom and are not animated, as I find the zooming animation a little slow on my older computer (it is framerate-dependent).<br /><br />Lastly, I added a main menu option, allowing the user to return to the login screen gracefully.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlqjr02F3VOhO1jEuhaB0nsHF5on0650JkJtN8cf5eAJ7FhD1F4zAD_Xy11UcmDvbv3LS9Mg1cICaqvINtuxMv1yqWqbeL1yd70FHvn6m_Ept5mhuyTG4ZhFHBX9nunp5XedjJbwpK4Mf-/s1600-h/menu.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlqjr02F3VOhO1jEuhaB0nsHF5on0650JkJtN8cf5eAJ7FhD1F4zAD_Xy11UcmDvbv3LS9Mg1cICaqvINtuxMv1yqWqbeL1yd70FHvn6m_Ept5mhuyTG4ZhFHBX9nunp5XedjJbwpK4Mf-/s400/menu.png" alt="" id="BLOGGER_PHOTO_ID_5232958343717497682" border="0" /></a>I discovered that logging in and out caused a lot of problems with the management of system resources. Models, images, interface elements and such needed to be unloaded and reloaded again, something which I could not find an "easy" solution for. In the end, I traced the loading of all the resources and added a corresponding unload command upon logging out.<br /><br />Regarding the linux installer, I edited the setup.py file so that the client installs in the same manner as the wxWidgets client. With that, the debian maintainers for Thousand Parsec will be able to package the client into a .deb file, although I'm considering whether to include the binary version of Python-Ogre inside as well, so that the package can run standalone.<br /><br />This week's focus has mostly been on the user interface, and I think any additional features will have to be put on hold for now, so that I can tie up the loose ends. For now, I will be writing the documentation and working on the mac installer, which is a giant time sink :)Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-27964380687560006872008-08-03T09:25:00.000-07:002008-12-09T01:44:09.826-08:00Sounds and BattleThis week I took a look at introducing sound into the client. I found <a href="http://mooproductions.blogspot.com/">OgreAL</a> a snap to use, it's API is modelled after the built-in Ogre managers such as material and resource manager, so not only was it familiar but also cleanly designed. Unfortunately, technical problems (crashes without any indication of the error - my favourite!) arose when I tried running the code, which I attributed to driver issues, as switching to "generic software" audio drivers - done by passing in a parameter during creation - solved the problem. This parameter is not available for Python-Ogre 1.1 which uses an older OgreAL API.<br /><br />So all I had left to do were the sound effects.<br /><br />As I mentioned, I found a <a style="" href="http://www.dspmusic.org/song04.html">program</a> for generating ambient soundtracks last week. It's really a sine wave generator and I'm currently trying it out as a background track. I haven't thought much about what sort of music would be suitable for a game of Thousand Parsec, perhaps I will have the client play any .ogg files it finds in the directory, similar to how Oblivion does it. This way, the user can specify his own soundtrack, although it would be nice to have some original music of our own too.<br /><br />I spent a while trying to create sounds for other parts of the client. Right now, I've put in a "engine rumble" and clicking sounds for buttons on the gui. Once again, I found a useful utility for these sounds, called <a href="http://www.cyd.liu.se/%7Etompe573/hp/project_sfxr.html">sfxr</a>. Most of the sounds produced are pretty lo-fi, but it's suitable for stuff like laser noises and the engine rumble was made from this too (plus some processing in audacity). Hm, there should be some way to embed sounds in blogs too...<br /><br />I think that the background track does add a lot of atmosphere, but my taste in music is pretty much like that anyway (see Drone Zone on SomaFM) so hopefully it won't annoy others. The sound effects will require a bit of tweaking as well, as their volume varies based on the user's location (automatically handled by OpenAL) and they can sound too loud or too soft at times.<br /><br />One of the primary motivations for adding sound was to supplement the Battle module, a standalone program for viewing BattleXML files.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOlhCUUsKBPeU61ouW-ae3lqI2jOmovasxg3jXbhZcQ9OOjIgSC2Fr3cnQ1YJATv_gHwJtWaMeDIGoqf4CkEBZ1-g2rZwj_XPdYUscH_hu-85MfPiG13pC5uMzF4hILjwm6uFWcpBesZD1/s1600-h/screenshot_2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOlhCUUsKBPeU61ouW-ae3lqI2jOmovasxg3jXbhZcQ9OOjIgSC2Fr3cnQ1YJATv_gHwJtWaMeDIGoqf4CkEBZ1-g2rZwj_XPdYUscH_hu-85MfPiG13pC5uMzF4hILjwm6uFWcpBesZD1/s400/screenshot_2.png" alt="" id="BLOGGER_PHOTO_ID_5230353403738271826" border="0" /></a><br />Currently, it does not process the actual battle, but it does create and show the initial locations of the fleets. I'm still figuring out how to define weapon locations and attach them to the ships, which should be fun once it is done. Also, there seems to be some texturing issues with the models as well, hopefully I can fix them in Blender.<br /><br />An additional windows installer script has been created as well, which actually just places the compiled client into your program files directory and create start menu shortcuts. The process of creating the installer actually exposed some bugs - although everything works, on shutdown the client outputs an error log, saying that some background threads had been forcefully shutdown, which made me realise that perhaps I hadn't been closing the client library threads properly, something that I have yet to look into.<br /><br />Next week, I will be finishing up the battle module and tying up loose ends:<br />- the starmap could use a navigation bar for zooming and centering<br />- the title screen should have the TP logo<br />- using theora to display the intro movie<br />- a minimap for lost players<br />- writing up documentation<br />- packaging linux and mac binaries (big problem here)Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-32020872978657249552008-07-27T09:17:00.000-07:002008-12-09T01:44:10.237-08:00Ship designs and order queuesAfter chatting with mithro this week, I found that the ship designer in the pywx client was an old part of the code (untouched in a year), and that ship design was not considered a priority (since only MTSec supports it). What I did instead was a viewer for ship designs in the game:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRrJa8q1Tjr1olWGUAzgAhSnYGRbRSLEjKAQKUswKZ8TQzwb7upQRe0pkF1_jBCAQBrvAVFIGJJSPBSrf4a-fw7YPgo7RSbYiqHbTqMQHYEm3TfFanwzocZMPfEsX2MsQksVaDw2q6S9Ve/s1600-h/ship+design.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRrJa8q1Tjr1olWGUAzgAhSnYGRbRSLEjKAQKUswKZ8TQzwb7upQRe0pkF1_jBCAQBrvAVFIGJJSPBSrf4a-fw7YPgo7RSbYiqHbTqMQHYEm3TfFanwzocZMPfEsX2MsQksVaDw2q6S9Ve/s400/ship+design.png" alt="" id="BLOGGER_PHOTO_ID_5227736558169272898" border="0" /></a>The design list on the left is colour coded by player, and the information pane is currently showing etower333's scout design. Wasn't that guy in a <a href="http://devhobby.blogspot.com/2008/07/some-interface-changes.html">previous</a> post as well? How long has that game been going on anyway?<br /><br />Order queue management has also been added.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5v4plEkuh-5g63FsAmjGG_mICXZIdRA7TbET_-dixwkjJwZiB4ixk8XM2GXEZ3-k6vwyUuIW1Mm7F2EAgGqYOpUiLvFTc2VQ2N_LN1nAhHzZ47ORXncqCHcUWV2bBXSQY79cGCDJ1Y_Lf/s1600-h/orders+queue.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5v4plEkuh-5g63FsAmjGG_mICXZIdRA7TbET_-dixwkjJwZiB4ixk8XM2GXEZ3-k6vwyUuIW1Mm7F2EAgGqYOpUiLvFTc2VQ2N_LN1nAhHzZ47ORXncqCHcUWV2bBXSQY79cGCDJ1Y_Lf/s400/orders+queue.png" alt="" id="BLOGGER_PHOTO_ID_5227738586242941090" border="0" /></a>After selecting an order from the queue, you can use the delete button to remove it or the edit button which will bring up the arguments window to edit the existing values. The new button also serves to create a new order after selecting from the available orders list on it's left. This change led me to venture back into the rather untidy order handling code, which I have cleaned up a little.<br /><br />A minor change is that double-clicking on an object will focus and zoom in on it.<br /><br />One thing I have been looking into is introducing sound and battle scenes into the client.<br /><br />Battle scenes in thousand parsec are defined by a BattleXML file, which is a file format detailing how many sides there are in a battle and the makeup of the individual fleets together with a turn-by-turn breakdown of how the battle went. A sample pygame viewer as well as documentation on the format can be gained from the <a href="http://git.thousandparsec.net/gitweb/gitweb.cgi?p=battleviewer.git;a=summary">battleviewer</a> git repository, although I have not run the viewer yet. One problem with BattleXML is that currently it is only supported by tpserver-py and not tpserver-cpp, which is the more popular server. Another issue is that it has to be implemented by the ruleset specifically and requires a media definition file to map 3d models to ingame objects as well as any weapon effects. Perhaps there could be a random battle generator so that support can be easily added for all rulesets?<br /><br />Sound support is already available in Python-Ogre via <a href="http://en.wikipedia.org/wiki/OpenAL">OpenAL</a>, a cross-platform api for 3d sound. So it's really a matter of finding the right sound effects. I've found a program called <a href="http://www.dspmusic.org/song04.html">song04</a> which generates ambient soundscapes, it sounds quite alright and I'll be trying it out as a background soundtrack next week.<br /><br />In somewhat related news, my old computer is probably on it's last legs as it frequently hangs upon startup (or the kernel starts to panic), and it has no internet access as the network adapter refuses to connect despite using the same settings which worked before. I guess it's rather fortunate that I got a new PC recently.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-44642405692498862052008-07-20T08:49:00.002-07:002008-12-09T01:44:11.018-08:00This week in TPThis week, I finally figured out how to do proper camera rotation in 3d. The actual code turned out to be simple. At first, I wanted to use <a href="http://en.wikipedia.org/wiki/Spherical_coordinates">spherical coordinates</a> to position the camera, as I had success with using polar coordinates for the radial menus. By storing the vertical and horizontal angles and treating radius as the zoom distance, I could convert them into 3d coordinates by applying some <a href="http://en.wikipedia.org/wiki/Spherical_coordinates#Cartesian_coordinate_system">formulas</a>. This worked only for rotations along the Z-axis (meaning that the world was "rolling", done by moving the mouse left and right). However, for rotations along the X-axis (pitch) it would refuse to rotate properly - upon reaching the horizon angle it would "bounce" back again.<br /><br />In the end, I put the camera inside an OGRE scene node, and made it the child of another scene node which would act as the focus. Hopefully this tilted diagram isn't too confusing:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8nlMPvfYcziUIVJexb2iBy5W6QQbhX0fz2aspsj9F5Jtp8is7T8YJg-FMHN3wNmbGl4F4C5xtlc59Q0jDHj9W_iWdSNnhKHiBOqCHm3zj-c4BkYe8B3Ea2z6GIqhPG7XW_NGFAIMFo3hi/s1600-h/camera+nodes.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8nlMPvfYcziUIVJexb2iBy5W6QQbhX0fz2aspsj9F5Jtp8is7T8YJg-FMHN3wNmbGl4F4C5xtlc59Q0jDHj9W_iWdSNnhKHiBOqCHm3zj-c4BkYe8B3Ea2z6GIqhPG7XW_NGFAIMFo3hi/s400/camera+nodes.png" alt="" id="BLOGGER_PHOTO_ID_5225129310331931554" border="0" /></a>In the diagram, you can see the camera floating at a distance above the map, which contains several planets. The focus node is always level with the other map objects, while the camera node can zoom back and forth. As I mentioned, the camera node is a child of the focus node and by rotating the focus node directly, OGRE will apply any transformations to it's child nodes, causing the camera to rotate around the focus node.<br /><br />Allowing the camera to look around freely posed a problem, mainly with the starry background as it was a flat field of stars. Here's a picture breaking the illusion:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho5nS8mSSXAX0yyOJ5MdwJHeEkGYvzB3K-VeaIikpM7bqQ3PMR35Ek_64SqQ9P7bOPzdnmTuuRCljXm24gfiyDHplFQAMYgVUtArUYE32eQNmOJoi0VUa3q6xV1IOmev0TeRnhtto9avOL/s1600-h/flat+starfield.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho5nS8mSSXAX0yyOJ5MdwJHeEkGYvzB3K-VeaIikpM7bqQ3PMR35Ek_64SqQ9P7bOPzdnmTuuRCljXm24gfiyDHplFQAMYgVUtArUYE32eQNmOJoi0VUa3q6xV1IOmev0TeRnhtto9avOL/s400/flat+starfield.png" alt="" id="BLOGGER_PHOTO_ID_5225131378777161058" border="0" /></a>Thankfully this was actually quite easy to fix. OGRE uses particle emitters, which spew out particles in various arrangements, and there was a Hollow Ellipsoid emitter which I could use to create a starfield surrounding the camera. The <a href="http://www.ogre3d.org/docs/manual/manual_35.html#SEC203">manual</a> is not very clear on how to use the Hollow Ellipsoid, the inner_ parameters are actually numbers with a range from 0.0 to 1.0 specifying the percentage of inner volume which should be hollow.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWT2bfSZuH_jjBfElFBaoAWLG5yFiV_eqM3wUsDtievhQI5VhUOZiLUNCvF5NCooaZj9WplL3I88-y5fk-5FmciAEnn3sSF6PvwINjOgQW5uxzpi6OGGtAB7Q3v3XeeN5fWpuMIyDeOnsg/s1600-h/normal+starfield.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWT2bfSZuH_jjBfElFBaoAWLG5yFiV_eqM3wUsDtievhQI5VhUOZiLUNCvF5NCooaZj9WplL3I88-y5fk-5FmciAEnn3sSF6PvwINjOgQW5uxzpi6OGGtAB7Q3v3XeeN5fWpuMIyDeOnsg/s400/normal+starfield.png" alt="" id="BLOGGER_PHOTO_ID_5225133450198829986" border="0" /></a><br />There always seems to be a cluster of stars at roughly around the same location, I'm not sure why. Letting the camera roam also let a few more issues crop up, such as the planet rotation. Previously, they were facing the player who was looking from overhead, since otherwise all the player could see would be their polar caps so I had to rotate them back again. Another stickier problem is the panning of the camera. Since the camera can pan in any direction, it screws up the zoom if the player pans downwards or upwards.<br /><br />Finally, the messages window layout has been changed to include a panel showing all the message headers. As I said in the previous post, the layout looks like it could do with some tweaking.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZbn7qvj4iyW5HrYi0f8UtX9K4IxfeTlhHirF-79FkoB9QmkpVDxxd453PAfl5ndbDHGa8EGtbznszwZz9ckbID0wHJVUbntWZLntzRmM-Ffmd69oOv6moSS_JiyC-H1q1WSuWZ5ola3t8/s1600-h/ogre+-+messages.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZbn7qvj4iyW5HrYi0f8UtX9K4IxfeTlhHirF-79FkoB9QmkpVDxxd453PAfl5ndbDHGa8EGtbznszwZz9ckbID0wHJVUbntWZLntzRmM-Ffmd69oOv6moSS_JiyC-H1q1WSuWZ5ola3t8/s400/ogre+-+messages.png" alt="" id="BLOGGER_PHOTO_ID_5225070015845704706" border="0" /></a>Next week, I will implement the ship design window, although I've not been able to create ship designs using the existing client yet, I should take a look at at least letting the player view the ship designs, or else he won't know how badass his fleets are. :)<br /><br />Another thing will be the order queue management, which refers to deleting and editing existing orders.<br /><br />There will be a turn update window, showing new events received upon a new turn.<br /><br />Finally, I will create setup packages for Windows, Linux (with the help of fellow Thousand Parsec developers) and Mac (which I will be working with my mentor for - this may take longer due to issues with Python Ogre). Although not a real release yet, getting the build process done will be a load off my mind. No use working on a project if nobody can run it after all. :)Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-74223066534601701622008-07-20T05:11:00.000-07:002008-12-09T01:44:12.573-08:00Interface comparisonThis post is mostly a screenshot comparison of the two different interfaces of the original wxWidgets client (tpclient-pywx) and the OGRE client (tpclient-pyogre). Okay, maybe they are not so different... but it would be interesting to see the layouts in different environments anyway.<br /><br />First off, we have the bread and butter of any 4x strategy game... the map. The pywx client shows each system and which objects are in that system, indicated by the circle surrounding it.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO7CNWRQsmocylOHSHl0UQOSI46rkynRWPbjZ06uhjYGiM1R_ErGyWVgA9fyOQVQ-kV47_GQBx-luhWlgOm8VGXg4m2sMsCUAaalLECnTEErRbZ38YYu3XrTOSFpSriIdR7BQrR_3ehWeK/s1600-h/wx+-+starmap.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO7CNWRQsmocylOHSHl0UQOSI46rkynRWPbjZ06uhjYGiM1R_ErGyWVgA9fyOQVQ-kV47_GQBx-luhWlgOm8VGXg4m2sMsCUAaalLECnTEErRbZ38YYu3XrTOSFpSriIdR7BQrR_3ehWeK/s400/wx+-+starmap.png" alt="" id="BLOGGER_PHOTO_ID_5225069449084086386" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVZ8ZQ_3r9-AsQhzQZ1a7jOfnVF1eNdXoTUo0xOsGr393h6D6gaJfTrziXrdeeCVhPKUREPcW52PQJ1nCDYt319mznNO9_UuX70EL9dVmBDIOlQv5WMICcfGMXdQ6ArQXUvoC1w-gavkDt/s1600-h/ogre+-+starmap2.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVZ8ZQ_3r9-AsQhzQZ1a7jOfnVF1eNdXoTUo0xOsGr393h6D6gaJfTrziXrdeeCVhPKUREPcW52PQJ1nCDYt319mznNO9_UuX70EL9dVmBDIOlQv5WMICcfGMXdQ6ArQXUvoC1w-gavkDt/s400/ogre+-+starmap2.png" alt="" id="BLOGGER_PHOTO_ID_5225069584476242626" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKIsCVIiRASFAyekcji4ohnnuT7dwW4QUIOLC23DC8aaEC560RqDgE4o9TaaYFZfxoVBK4m_aAP2Ax81K4QGGTDKnIKSBwwcjqtn2DMz2vZxX3fP3ToBWhnHfmu1MvoXOOPbKD2Gms2eR6/s1600-h/ogre+-+starmap.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKIsCVIiRASFAyekcji4ohnnuT7dwW4QUIOLC23DC8aaEC560RqDgE4o9TaaYFZfxoVBK4m_aAP2Ax81K4QGGTDKnIKSBwwcjqtn2DMz2vZxX3fP3ToBWhnHfmu1MvoXOOPbKD2Gms2eR6/s400/ogre+-+starmap.png" alt="" id="BLOGGER_PHOTO_ID_5225069769310563202" border="0" /></a><br />The pyogre client has two views: an "iconised" view when the player is zoomed out, and a 3d view when viewing objects close up.<br /><br />The pywx client keeps new order parameters and the order queue within the same area:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg55D8wcPzTFR5iOKMXCGsqc8Baad_SX2D1fBTVIyEVJx0EQ-YDneIKYK6sgvz8o31NKkx8v_R4pP10aOqXEK5Vjhniiq-mhhfoaH6QsD8bo1NiAfAx650AbXtXU9h0IViXgn1N40kCXQYA/s1600-h/wx+-+orders.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg55D8wcPzTFR5iOKMXCGsqc8Baad_SX2D1fBTVIyEVJx0EQ-YDneIKYK6sgvz8o31NKkx8v_R4pP10aOqXEK5Vjhniiq-mhhfoaH6QsD8bo1NiAfAx650AbXtXU9h0IViXgn1N40kCXQYA/s400/wx+-+orders.png" alt="" id="BLOGGER_PHOTO_ID_5225070299810291890" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX9sk7e-HXDdGqhH6rHcZjHf9RtfAX1UxfNWO6w8A1yXp_REeuQdS8Gy-MXHSOizoZ1FwZytB3cBYsskHU-av6sRWbkln4YPBNTjJ2Og9tRnSooOBVJPiejQh2UFALDxSzVwwkKkTGudRt/s1600-h/ogre+-+orders1.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX9sk7e-HXDdGqhH6rHcZjHf9RtfAX1UxfNWO6w8A1yXp_REeuQdS8Gy-MXHSOizoZ1FwZytB3cBYsskHU-av6sRWbkln4YPBNTjJ2Og9tRnSooOBVJPiejQh2UFALDxSzVwwkKkTGudRt/s400/ogre+-+orders1.png" alt="" id="BLOGGER_PHOTO_ID_5225070305823543250" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt1NnCFSLB3Blp6LC55SVmpwk8WOKCDjiwUB3OO6JVw6fP0cUSksxHm2cbyrJkkmcGKHsUTB00eLnVsbQ6m-TlU9H76CdERd6Nl2vgFmBGp54j46nwvZJP0EzjyW4P5uruSczxG9Y3myal/s1600-h/ogre+-+orders2.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt1NnCFSLB3Blp6LC55SVmpwk8WOKCDjiwUB3OO6JVw6fP0cUSksxHm2cbyrJkkmcGKHsUTB00eLnVsbQ6m-TlU9H76CdERd6Nl2vgFmBGp54j46nwvZJP0EzjyW4P5uruSczxG9Y3myal/s400/ogre+-+orders2.png" alt="" id="BLOGGER_PHOTO_ID_5225070309314879698" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKfgOWpSJzmQ9d8r1uSQaFT-c-PkaAzGF7o5pEOLbNAKrlDAovXsa91nBs5VsYULaiNr4sfXS9xyyxphPcSzUQMopY1lmKO3n4gWhfkZVBOOGHXiTglB-I660XQzdcFvQCVVrwBapTBJ3V/s1600-h/ogre+-+ordersqueue.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKfgOWpSJzmQ9d8r1uSQaFT-c-PkaAzGF7o5pEOLbNAKrlDAovXsa91nBs5VsYULaiNr4sfXS9xyyxphPcSzUQMopY1lmKO3n4gWhfkZVBOOGHXiTglB-I660XQzdcFvQCVVrwBapTBJ3V/s400/ogre+-+ordersqueue.png" alt="" id="BLOGGER_PHOTO_ID_5225070309753860066" border="0" /></a><br />In the pyogre client, new orders are chosen from a radial menu, which produces the new order window.<br />There is also a separate order queue window for manipulating the orders of the selected object (not yet, sorry :()<br /><br />The pywx system viewer shows the tree of all objects in the game.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRVDuDO9_wWJJEbgGHIIkVKXussNO8LlRG9rvouL0IwfYlDJ5-WX3AyvBBeNpGifi7lTGFg_2HoRyHLI3Z6ZPslxvPv4va_IUSYK84L_ElMqBXlCAwDVjJMmVWOlaZ7rWu7z2JsRarKSK9/s1600-h/wx+-+system.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRVDuDO9_wWJJEbgGHIIkVKXussNO8LlRG9rvouL0IwfYlDJ5-WX3AyvBBeNpGifi7lTGFg_2HoRyHLI3Z6ZPslxvPv4va_IUSYK84L_ElMqBXlCAwDVjJMmVWOlaZ7rWu7z2JsRarKSK9/s400/wx+-+system.png" alt="" id="BLOGGER_PHOTO_ID_5225070316333147650" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0HyjN9tTMs38fsM5aygpzZOP3YxwKCK_TxkhIF5wLQBvcsmsINfawPmwUpgZJ_7Nx6NUI5X4apST_zE26ZHDptBaqfG0Wmw4Vg4g31vzLjoCgZmuz7S-7sHpJOEKoIAwH95BHf80-Gkqs/s1600-h/ogre+-+system.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0HyjN9tTMs38fsM5aygpzZOP3YxwKCK_TxkhIF5wLQBvcsmsINfawPmwUpgZJ_7Nx6NUI5X4apST_zE26ZHDptBaqfG0Wmw4Vg4g31vzLjoCgZmuz7S-7sHpJOEKoIAwH95BHf80-Gkqs/s400/ogre+-+system.png" alt="" id="BLOGGER_PHOTO_ID_5225070437067250322" border="0" /></a><br />The pyogre system viewer needs some work, once the client fully makes the move to CEGUI 0.6 I'll be able to include the new tree widget in.<br /><br />Information window, showing some attributes of the currently selected object. I've always thought it looked a bit like debugging output. :)<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB-y2OaDmk0DYV2Ib80WT4zENrJIWK2yrJLTc5xUCR0aibmQNocWoEGdzM_hyphenhyphenAxzGTssST69U9PGhvl17zr9wyQ2LuPAzqxgBmy6j0vLkU99hqPzNKUGlEkaZWYpHFjowxl7T-0skdwciZ/s1600-h/wx+-+information.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB-y2OaDmk0DYV2Ib80WT4zENrJIWK2yrJLTc5xUCR0aibmQNocWoEGdzM_hyphenhyphenAxzGTssST69U9PGhvl17zr9wyQ2LuPAzqxgBmy6j0vLkU99hqPzNKUGlEkaZWYpHFjowxl7T-0skdwciZ/s400/wx+-+information.png" alt="" id="BLOGGER_PHOTO_ID_5225072642380663042" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhAEeGLK4D0j3_by4TfTqN8B4dlu1zhRPrN8ilyqVks74gsq5xe61f32RyaJsZqCstkyXqCQTC3e1Dgpro3y9KBFTfnaMez_wEULWQW6rZlRE6-GzvjiDP1GnKvYuqee5slnAiIULprWd0/s1600-h/ogre+-+information.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhAEeGLK4D0j3_by4TfTqN8B4dlu1zhRPrN8ilyqVks74gsq5xe61f32RyaJsZqCstkyXqCQTC3e1Dgpro3y9KBFTfnaMez_wEULWQW6rZlRE6-GzvjiDP1GnKvYuqee5slnAiIULprWd0/s400/ogre+-+information.png" alt="" id="BLOGGER_PHOTO_ID_5225070007793999458" border="0" /></a><br />The information window for pyogre shows similar details.<br /><br />The message window for pywx, which supports html and can open your browser if a message contains hyperlinks.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrsyB-sateaclNy_OUvPUT58ExNtaFruHPOVHjKuaYCB0Nz9jKUfawn6PJx6Mcq3hLzye0mRS95CpSiwwEb1KbpXo1L_sxZ2DvNNt7DPOZ0MWVCL_Ti1GYQmhw5YSM_EvsIWIz_Kcy8N4M/s1600-h/wx+-+messages.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrsyB-sateaclNy_OUvPUT58ExNtaFruHPOVHjKuaYCB0Nz9jKUfawn6PJx6Mcq3hLzye0mRS95CpSiwwEb1KbpXo1L_sxZ2DvNNt7DPOZ0MWVCL_Ti1GYQmhw5YSM_EvsIWIz_Kcy8N4M/s400/wx+-+messages.png" alt="" id="BLOGGER_PHOTO_ID_5225070011821575346" border="0" /></a> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZbn7qvj4iyW5HrYi0f8UtX9K4IxfeTlhHirF-79FkoB9QmkpVDxxd453PAfl5ndbDHGa8EGtbznszwZz9ckbID0wHJVUbntWZLntzRmM-Ffmd69oOv6moSS_JiyC-H1q1WSuWZ5ola3t8/s1600-h/ogre+-+messages.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZbn7qvj4iyW5HrYi0f8UtX9K4IxfeTlhHirF-79FkoB9QmkpVDxxd453PAfl5ndbDHGa8EGtbznszwZz9ckbID0wHJVUbntWZLntzRmM-Ffmd69oOv6moSS_JiyC-H1q1WSuWZ5ola3t8/s400/ogre+-+messages.png" alt="" id="BLOGGER_PHOTO_ID_5225070015845704706" border="0" /></a><br />The message window for pyogre. It looks a bit 'chunky', maybe I should have an option to toggle the message list panel?<br /><br />The design window. I have been working on this feature, but it is not complete yet as I can't seem to create new designs in MTSec, even with the pywx client.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_YentpLE6coGqAIohU_m1Tpn9NgbDlIXxORqTMzPZX-0HbOty8P4XotfBuevox0bjtXK7aj0Dlia0A9s37jZyr5I9w-34dEMKfKjcp72bOCDLHWtp32GZEkvwlXoaxIAf4e1DC_jvA0p1/s1600-h/wx+-+design.png"><img style="vertical-align: top; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_YentpLE6coGqAIohU_m1Tpn9NgbDlIXxORqTMzPZX-0HbOty8P4XotfBuevox0bjtXK7aj0Dlia0A9s37jZyr5I9w-34dEMKfKjcp72bOCDLHWtp32GZEkvwlXoaxIAf4e1DC_jvA0p1/s400/wx+-+design.png" alt="" id="BLOGGER_PHOTO_ID_5225070434474796722" border="0" /></a>Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-38029408657945519692008-07-13T09:36:00.000-07:002008-12-09T01:44:12.673-08:00Animated cameraThis week, added some animation to the camera movement to make it more smooth. When zooming in or out, it will move gradually instead of instant 'steps' like before. In addition, there will be animated panning when a system is double-clicked on the system list, or when pressing 'c' to center on the selected object, or when pressing "goto" in the message window. Since it will move in steps every frame, it is somewhat slow when the frame rate is low. This could be solved by having calculating the step size based on the frame rate. A harder problem is how to rotate a camera in a spherical manner around an object, which is probably a staple of most 3d games.<br /><br />I also added some movement for the ships which will occur after a turn update. This allows you to roughly see where they are going, particularly for enemy fleets.<br /><br />I guess this week's changes are mostly animation based, so it's a little hard to take screenshots.<br /><br />Some additional minor fixes<br />Message window parses html messages now. This was largely thanks to Tim Ansell's suggestion to look at the htmllib and formatter library that comes with python, which saved me from having to strip out the tags manually. I still can't believe the breadth of python's built-in libraries sometimes. Batteries included indeed. One possible addition is to add additional formatting according to the html tags, right now I'm just stripping them out adding line breaks appropriately:<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ7sgEgZhu8uT6hkuawk_907nsHy_nEdBWf7TMTYGpIVOU7_eAm8MKWMwfkgy-cfJrvu92Zjd_xPTNkwzlYJsAvhG6Y9R6c7_B8S1rFD1_pp39_Yu53TIdzpMrdf3O3ZqEES538eKZSfmr/s1600-h/screenshot_1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ7sgEgZhu8uT6hkuawk_907nsHy_nEdBWf7TMTYGpIVOU7_eAm8MKWMwfkgy-cfJrvu92Zjd_xPTNkwzlYJsAvhG6Y9R6c7_B8S1rFD1_pp39_Yu53TIdzpMrdf3O3ZqEES538eKZSfmr/s400/screenshot_1.png" alt="" id="BLOGGER_PHOTO_ID_5222553938473815922" border="0" /></a><br />The keyboard shortcuts for zooming in and out (the plus and minus key next to the backspace) is fixed now. Previously, it was stuck in 'icon view' all the time.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-2178946963170185122008-07-05T08:18:00.000-07:002008-12-09T01:44:13.469-08:00Some interface changesThis week, I have added some additional elements to the user interface in order to make it more user-friendly.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFpK1C23hMT-Iyom70vDY5Y0GUVhmdZWw38W-pYKVQTdx2ggiuHTMRg1zoHLKWuVunuXw0J0mSYYPY0P8YZGPgGOd0IBqV_pINxp3Aq7Y88ueJ_m-RHK2OWGQXxuTHOV6GI8aJYR1maojs/s1600-h/screenshot_1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFpK1C23hMT-Iyom70vDY5Y0GUVhmdZWw38W-pYKVQTdx2ggiuHTMRg1zoHLKWuVunuXw0J0mSYYPY0P8YZGPgGOd0IBqV_pINxp3Aq7Y88ueJ_m-RHK2OWGQXxuTHOV6GI8aJYR1maojs/s400/screenshot_1.png" alt="" id="BLOGGER_PHOTO_ID_5219556491402859746" border="0" /></a><br />The first would be the turn counter in the top-left hand corner, which is handy for knowing how long the game has been progressing for someone who is joining in half-way, and for knowing the current 'phase' in rulesets like Reach for The Stars, where there are three phases and certain orders are possible depending on the phase. However, it does not actually show the phase - the user will currently have to calculate it on his own.<br /><br />Another difference is the End of Turn timer in the bottom bar, showing how many seconds are left until the turn is over. The 'End' button next to it is used to tell the server that you are done with your current turn, although this step must usually be taken by the majority of players before the server actually finishes the turn.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_oj3-ebP7j4aSmrsci9chdkWgtfcHtKj7ZKmbu5-AoiQH79p-BtwR3N2Sz2vYBpA7Xy2sWilRG3ueP2s3d-WKMLqK00Dv4p4r0q89nPIFOKdMdm2CNpOlQJXXHtY0wu-8g_9uMYw7rusw/s1600-h/screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_oj3-ebP7j4aSmrsci9chdkWgtfcHtKj7ZKmbu5-AoiQH79p-BtwR3N2Sz2vYBpA7Xy2sWilRG3ueP2s3d-WKMLqK00Dv4p4r0q89nPIFOKdMdm2CNpOlQJXXHtY0wu-8g_9uMYw7rusw/s400/screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5219565400070482434" border="0" /></a>Next, when the user hovers the mouse cursor over any object on the starmap, a popup will display with some information about that object such as their name and owner (if any). In addition for fleets, the composition of the fleet will be shown, while planets will display their resources and star systems will just show how many planets they contain. One thing I'm trying to figure out is how to dynamically resize the popup in accordance to the text contained, to prevent text overrun such as in this case:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTsuV9eWm7WRRTf-8asbjDlPUQPRlsQtJmgVft8hwsomhjwDDkF-eVtdXUcT14ywexM6PDGNZQjFus_o7742dXmj1cqwhA2KBCfadrEHyOzNP8dxxkU_GJVo3Xy14yrIL1-N7nnpSGxT0F/s1600-h/screenshot_4.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTsuV9eWm7WRRTf-8asbjDlPUQPRlsQtJmgVft8hwsomhjwDDkF-eVtdXUcT14ywexM6PDGNZQjFus_o7742dXmj1cqwhA2KBCfadrEHyOzNP8dxxkU_GJVo3Xy14yrIL1-N7nnpSGxT0F/s400/screenshot_4.png" alt="" id="BLOGGER_PHOTO_ID_5219567834333906642" border="0" /></a>etower333's home planet - In the minisec ruleset, the home planet of a player is defined by having "Home Planets" in their list of planetary resources.<br /><br />Another change made is to tweak the icon view so that it colours the icons according to their owner:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIfyT9xmRGcej3Z04Uu76Y4wC8L-Eqc0aUVv0Upk2kWfa42RR90voUKugPGQbk2haNYnYAsDc1hdvJmUd4yCXvctSVXA9Tk_FdQyOlBPxWaYOl-hHEw7L3lanS66TF7cHFdR4nKIK_OE0T/s1600-h/screenshot_3.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIfyT9xmRGcej3Z04Uu76Y4wC8L-Eqc0aUVv0Upk2kWfa42RR90voUKugPGQbk2haNYnYAsDc1hdvJmUd4yCXvctSVXA9Tk_FdQyOlBPxWaYOl-hHEw7L3lanS66TF7cHFdR4nKIK_OE0T/s400/screenshot_3.png" alt="" id="BLOGGER_PHOTO_ID_5219569238952950866" border="0" /></a><br />This makes icon view a lot more useful, especially as I'm still working out how to show ownership of planets in 3d view without colouring the entire planet.<br /><br />A common issue with network applications is having the server down, or providing incorrect credentials, so an error message will be displayed when this situation occurs.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiljmvW9VSpt_Vz9fgOd1ZClDykUFMxevDOqAhlL4RGD2nCIAoTaHpT0gA3WxnA9jvXy4vdXOzrjI34hGE2tpjoIU-EXLv1gSbAqdUEVqRtQBR6AE8S5iIePTPfKQMCaV3lnslBDRcSOclc/s1600-h/screenshot_2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiljmvW9VSpt_Vz9fgOd1ZClDykUFMxevDOqAhlL4RGD2nCIAoTaHpT0gA3WxnA9jvXy4vdXOzrjI34hGE2tpjoIU-EXLv1gSbAqdUEVqRtQBR6AE8S5iIePTPfKQMCaV3lnslBDRcSOclc/s400/screenshot_2.png" alt="" id="BLOGGER_PHOTO_ID_5219571460987942482" border="0" /></a>I'll be looking out for more areas where I can put information or error messages, but I probably won't post about it again as it's quite minor in implementation (though important).<br /><br />One suggestion was to have a way of selecting between objects that are clustered closely together when the view is zoomed out. In the wxwidgets client, clicking on a star system will cycle through all the objects in orbit around that system, so I have attempted to make something similar - when clicking multiple times on the same spot, the client will cycle through objects overlapping that area.<br /><br />Issues encountered this week<br />A new version of python-ogre was recently released (1.2 RC2), and contains a huge amount of changes from RC1. After downloading the windows build, I found that it wraps versions of ogre that I had never even heard of! (1.7 in this case - the latest stable version is 1.4.9 and the <span style="font-style: italic;">next</span> slated release is 1.6, codenamed Shoggoth. Talk about bleeding edge. :)) Needless to say, it brought a few interface-breaking changes with it and I was considering whether to port the project over or not. One desirable thing about RC2 is that it supports CEGUI 0.60 which comes with a brand new tree widget - something which I'm sure would be very useful. One course of action might be to compile a custom version of python-ogre with just the new stuff that I need - something quite easy to do on linux as I just have to change some version numbers in the build scripts. On the other hand, that would make it more difficult for people to just download the source and run it when they already have python-ogre installed. I think that for now, the client will continue to target the previous version of python-ogre (1.1 since 1.2 RC1 has disappeared) until I can wrap my head around all the new stuff that's just come in.<br /><br />Things to come next week<br />I will be working on animating the camera view to make it smoother (for instance, zooming in and out should be gradual and not abrupt) while making it possible to rotate around an object.<br /><br />Also, I want to revamp the messages window to implement the great suggestion of having a two-paned system, and to handle messages with html tags in them, although I'm not very sure how I'm going to do that at this point.<br /><br />Thirdly, I want to squish all of the bugs I've found so far. :)Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com1tag:blogger.com,1999:blog-5359522288090977052.post-66942559436818421442008-06-28T09:38:00.000-07:002008-12-09T01:44:15.223-08:00Progress bar and preferencesThis week, I added a progress bar which will show the status of connecting and downloading objects from the server.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4NlVfE0MISWmvc9c5LdZvATc4RwRRiUesKKAYEEvBLgP6lPNK0C5UDABin7s4sS0WtdHPMircqaQPA8pa8K6Bt_JDo81tFE_fFbubOfkKW1PPyad_ZrvPn-rk9OUGrVMs4qks9SD2LItE/s1600-h/screenshot_1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4NlVfE0MISWmvc9c5LdZvATc4RwRRiUesKKAYEEvBLgP6lPNK0C5UDABin7s4sS0WtdHPMircqaQPA8pa8K6Bt_JDo81tFE_fFbubOfkKW1PPyad_ZrvPn-rk9OUGrVMs4qks9SD2LItE/s400/screenshot_1.png" alt="" id="BLOGGER_PHOTO_ID_5216985258290746994" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisImD7x-ju_pSQ8CyxvLS0xdhzyeAzyciXp5CGIv0SYpRvVOAv1M4bVf8Cg4qoeCVueQtIhgMWe_ObXZN-THRqRA6IQzY1hokvP-WNQkCzBMl_sLJtXm5r2WdRrzoVqyeUr118x9FjOpTn/s1600-h/screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisImD7x-ju_pSQ8CyxvLS0xdhzyeAzyciXp5CGIv0SYpRvVOAv1M4bVf8Cg4qoeCVueQtIhgMWe_ObXZN-THRqRA6IQzY1hokvP-WNQkCzBMl_sLJtXm5r2WdRrzoVqyeUr118x9FjOpTn/s400/screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5216985157118548386" border="0" /></a><br />Having a progress bar is crucial as users will not be expected to look at console output to determine what is going on. This was implemented by using Ogre's built-in progress bar and tweaking the code as well as colours to match with the current gui scheme. The progress bar shows up when connecting to a new game, and also when updating objects in-game. The background is blanked out to prevent sending orders during updates, however it looks very empty right now, so I'm thinking of putting up some of the thousand-parsec art as the loading screens.<br /><br />One bad point about the client is that it runs slowly on systems without a 3d card, although I'm not decided on what minimum requirements I should be targeting. One suggestion made was to make the icon view (the map with abstract icons) dependent on frames per second, meaning that when the performance gets too low, the client should switch to icon view. I tried this out and it gave me some issues, specifically with how to switch the client back into 3d mode. Since switching to icon mode speeds up the rendering time, the client will keep switching back and forth between the two modes making the user feel nauseous. As a compromise, I made a preferences window for users to set the zoom level at which the client will switch to icon view. The window is summoned by clicking the "Config" button on the Login screen.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5rGSyv1lBO9eMIb_2FUs62GNsuXE63MvxhpO7V-9tS9Shm8JwTYViJ0KoZ9sDBxZNiXvag3iNADsNSixY8J8A_YbKf5gYinNvoQuRA61QF9SfKZp_E5KDRwE02FQSf07rUSwO_vM-wSF6/s1600-h/screenshot_2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5rGSyv1lBO9eMIb_2FUs62GNsuXE63MvxhpO7V-9tS9Shm8JwTYViJ0KoZ9sDBxZNiXvag3iNADsNSixY8J8A_YbKf5gYinNvoQuRA61QF9SfKZp_E5KDRwE02FQSf07rUSwO_vM-wSF6/s400/screenshot_2.png" alt="" id="BLOGGER_PHOTO_ID_5216974273603279442" border="0" /></a><br />The thousand-parsec project has kindly provided us with some <a href="http://www.thousandparsec.net/%7Ejmtan/">hosting </a><a href="http://www.thousandparsec.net/%7Ejmtan/">space</a>, so I will be putting up windows binaries in order to get some feedback. I have been messing around with tools like Inno Setup, but for now it is simply a self-extracting file.<br /><br />My objective for the coming evaluation is to make the client as playable with the Reach for the Stars ruleset as I can, and at first I wanted to focus on the ship design component, until I learnt that RFTS does not require the user to create their own designs, which leaves MTSec as the sole ruleset with player-designable ships. I feel there is scope for adding some cool stuff here - ship design has always been a favourite of many 4x games.<br /><br />Currently, I have the following issues to fix:<br />Select objects which are very close to each other - It is hard to click on objects, especially when they are clustered together, so clicking on a cluster of objects should bring up a menu to choose from.<br /><br />No good way to indicate which planets are yours, the enemy's, or neutral - Perhaps have a coloured rectangle somewhere around it to serve as a flag.<br /><br />Having a turn counter, to keep track of the current phase in rulesets like RFTS. Related features to this also include an End-of-Turn counter keeping track of the time before the turn updates.<br /><br />I will be working on these issues tomorrow, as soon as I compile the latest version.<br /><br />P.S. (ugly personal confession) - I guess I should have seen it coming, but this week saw a lot of distractions due to my powerful new system and it's ability to play the latest games, not to mention the Euro 08 tournament. Am I allowed to call playing Sins of a Solar Empire as doing research? Really sorry... I will make up for lost time next week somehow.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com1tag:blogger.com,1999:blog-5359522288090977052.post-29452336999920023462008-06-21T06:15:00.000-07:002008-12-09T01:44:15.622-08:00Icon viewFor this week, I've been trying to implement a view where all the objects appear as icons when the user is zoomed out. The advantages of having an icon view are that the objects tend to get harder to spot when far, as well as harder to click on. Also, it's a good way to increase the frame rate when viewing many systems at once. At first, I tried making icons with letters on them, where an 'F' would represent a fleet, a 'P' would represent a planet and so on. However, the letters turned out to be too hard to read, so I went for pictures instead.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiclBhzrFQ451NoTTz5N29xq50QuTxyO-bfE_NNpnX6jQhwgTE2QzqdxKffql9VTIfPolO8wiaNMUNq3qONV9vb9y16yza0wycKo7QqXhC-CFNJIXuGEesVDtqdBFuEYGuPsPz1JMEgURqw/s1600-h/screenshot_7.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiclBhzrFQ451NoTTz5N29xq50QuTxyO-bfE_NNpnX6jQhwgTE2QzqdxKffql9VTIfPolO8wiaNMUNq3qONV9vb9y16yza0wycKo7QqXhC-CFNJIXuGEesVDtqdBFuEYGuPsPz1JMEgURqw/s400/screenshot_7.png" alt="" id="BLOGGER_PHOTO_ID_5214338110889134498" border="0" /></a><br />Hopefully what the icons represent is clear enough. Triangles for the fleets and circles for the planets and stars. I haven't coloured the objects according to which player they belong yet, but the colour scheme should be the same, except that I can now colour the planets as well. I'm not sure how to represent different ship types, perhaps I could scale the size of the triangle icon?<br /><br />Another thing I've been working on is trying to create a starfield for the background. Since the current background code is slow, I tried a few different alternatives to the particle system approach.<br /><br />The first thing I tried was to create a static image for the background, then make it into a skybox. At first, it looked okay:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGxsR8FY5Lq1wRDz-KpnIUcdX_IyOeJQR-PPQBYci6o1hJ4hWGivvC6Gp6r1rNDv-deiw160fFIJ9J6t-oeSxZ5zIQlkPtwDE1vgxAS_q0xaYDMSV_wvLnXyb0N1BkWaJYCjllmWHjeCrf/s1600-h/screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGxsR8FY5Lq1wRDz-KpnIUcdX_IyOeJQR-PPQBYci6o1hJ4hWGivvC6Gp6r1rNDv-deiw160fFIJ9J6t-oeSxZ5zIQlkPtwDE1vgxAS_q0xaYDMSV_wvLnXyb0N1BkWaJYCjllmWHjeCrf/s400/screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5214343955133743394" border="0" /></a>However, at the corners of the skybox the stars appeared warped which made it unusable. I'm not really sure how to solve that issue; after some googling I found one method of using blender to map a sphere and then render the result, but I must have screwed up somewhere because the result looked even worse.<br /><br />In the end, I went back to the same approach but reduced the "layers" of stars and replaced the star image with a pixel instead. This seemed to give me somewhat better performance. I also made the starfield stay at the same distance when the camera zooms in or out which should make it look more natural during movement. I'm still not too happy with the look of it, but I'm out of ideas for this at the moment.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzpsVxB3llTgsCdxJUzrOgh3eN-7SHPhJo4oveh37Q5TINCmkygFmpbT8aWtK29DHcDhpVzZYajte6t4QefXD3PVJbUDe4_Aqkyu_SVigOKosfps1vY6wpMHwBbTA7R6A9SKYOFz2flWc/s1600-h/screenshot_8.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzpsVxB3llTgsCdxJUzrOgh3eN-7SHPhJo4oveh37Q5TINCmkygFmpbT8aWtK29DHcDhpVzZYajte6t4QefXD3PVJbUDe4_Aqkyu_SVigOKosfps1vY6wpMHwBbTA7R6A9SKYOFz2flWc/s400/screenshot_8.png" alt="" id="BLOGGER_PHOTO_ID_5214664637544544466" border="0" /></a>This week hasn't seen too many updates, reason being I just got a new computer and I'm trying to install Mac OSX on it. With a little luck, I can try supporting the Mac versions of the client in the future.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com2tag:blogger.com,1999:blog-5359522288090977052.post-51091311823259492112008-06-16T10:16:00.000-07:002008-12-09T01:44:16.040-08:00Just playing aroundToday, I decided to take a little break from coding and explore some of the other projects in the Thousand Parsec universe.<br /><br />Quite a few of the GSOC projects (the two AI projects and the <a href="http://code.google.com/soc/2008/parsec/appinfo.html?csaid=7731B9B4B375E2E5">server configuration</a> project) focus on allowing TP to be played by a single player. This is very exciting and I'm already envisioning creating a coffee-break ruleset similar to <a href="http://www.digital-eel.com/sais/">strange</a><a href="http://www.digital-eel.com/sais/"> adventures in infinite space</a>. :)<br /><br />After reading through the list, I wanted to try out some of the rulesets, particularly Risk as it has a playable version available <a href="http://www.hammerofcode.com/2008/06/basic-buggy-but-basic/">already</a>. Unfortunately, due to my noobishness in gcc compilation I was unable to get the git version of tpserver-cpp (where all the rulesets are stored) working. What I tried instead was to copy the risk folder over to my working tpserver 0.5 directory and compile it instead. This seemed to work at first:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuYbOjhU2nmYTweB0zLv7A0NP1BdDVQNyajz5YaVmu6X4PpGwp7Ct92M5_cPsZd2BT38i6oj8toa_G_Zgq0R64nUoKJACRpLsRBIXVCwuQARcfD4A5O8UKt3gTOrb41Y05h9C4MBnKmOnQ/s1600-h/risk+ruleset.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuYbOjhU2nmYTweB0zLv7A0NP1BdDVQNyajz5YaVmu6X4PpGwp7Ct92M5_cPsZd2BT38i6oj8toa_G_Zgq0R64nUoKJACRpLsRBIXVCwuQARcfD4A5O8UKt3gTOrb41Y05h9C4MBnKmOnQ/s400/risk+ruleset.png" alt="" id="BLOGGER_PHOTO_ID_5212533486712219906" border="0" /></a>The screenshot shows the client connected to a server running the risk ruleset. Unfortunately, I could not seem to get the game working properly, as it did not assign me any planets or ships to start with. This problem also existed in the tpwx client, so I suppose the ruleset requires the latest tpserver in some manner.<br /><br />Slight disappointment aside, I spent the latter part of the day looking at how I could improve the frame rate of the client somehow. The base fps on the client is very low, and even when the screen is not showing anything (all objects are culled) the framerate is clipped at around 40 fps. I found the bottleneck to be the starry background code, once I commented it out the framerate became about 99 fps (still without looking at anything).<br /><br />Level of detail, in which objects reduce their polygon count as the camera becomes further, was another technique I wanted to apply. Thankfully, this turned out to be easy as I simply had to run OgreMeshUpdate (a program bundled with Ogre) on the models I wanted. After trying a few options, the framerate went up to about 15-16 fps. After a while I noticed some corruption in the model skin due to polygon reduction.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAQ9sMBZyQkycH3Df5oBYP5jLRFX3so6VSqWhWS6_oWlf0bbM5NycKpfC-H2k8hpjhL9J6T65pubGLDU9p8j4uq6JTfWWDutGK06RNnMSMXGmuvu8sYntLvk1CPseehctK-PXoXyeG-2wZ/s1600-h/lod+corruption.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAQ9sMBZyQkycH3Df5oBYP5jLRFX3so6VSqWhWS6_oWlf0bbM5NycKpfC-H2k8hpjhL9J6T65pubGLDU9p8j4uq6JTfWWDutGK06RNnMSMXGmuvu8sYntLvk1CPseehctK-PXoXyeG-2wZ/s400/lod+corruption.png" alt="" id="BLOGGER_PHOTO_ID_5212537447509552114" border="0" /></a>What I did was to tweak the distance levels so it only reduces when really far. I guess someone who can see at the pixel level might still notice it though.<br /><br />After that, I rebooted in Windows to try creating a binary using py2exe. Since the script was already written, packaging it was not difficult but what I did notice was a tremendous boost in fps when I ran the client.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRPhX5rHxLuJIzmyaIMGd2_ffFfQtz3nzPPRfizXIMjV9Dnd1roafs4Pjz7sfbYp5RzGE60zXmMJ-5ouFGqQFGGURYu1wzEafu4jmvUFUZ8qj01ZYcleqI-iUm1CJzhY7y-l4QzWy1V0Sr/s1600-h/screenshot_3.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRPhX5rHxLuJIzmyaIMGd2_ffFfQtz3nzPPRfizXIMjV9Dnd1roafs4Pjz7sfbYp5RzGE60zXmMJ-5ouFGqQFGGURYu1wzEafu4jmvUFUZ8qj01ZYcleqI-iUm1CJzhY7y-l4QzWy1V0Sr/s400/screenshot_3.png" alt="" id="BLOGGER_PHOTO_ID_5212539564627971826" border="0" /></a>Here's a "action-packed" shot of the client connected to the demo tp server. With 6x anti-aliasing and 1280x1024 resolution, it still has better fps than the linux version. Wow, windows is great! Actually, the cause of the difference is probably my linux drivers. Since ATI has abysmal driver support, I'm running the open-source drivers which are slower in 3d performance but at least they work. (ATI drivers give me graphical corruption even when browsing the net or openoffice)<br /><br />Here are my relevant system specs consisting pretty much of last-gen hardware.<br /><br />Processor: Can't remember the model, but windows reports it as a 1.3 ghz Athlon.<br />RAM: 1 gig. I thought it was overkill when I first bought it.<br />Video card: Radeon 9800 Pro. I'll get Nvidia next time.<br />Motherboard: Nvidia nForce-2. Irony?Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com5tag:blogger.com,1999:blog-5359522288090977052.post-26561676482298934162008-06-15T18:39:00.000-07:002008-12-09T01:44:16.146-08:00Status ReportThis one is a little late, but anyway here is a recap of what I did last week.<br /><br />Fixed the goto button for the messages window thanks to lots of help from mithro and greywhind in irc. Now clicking on it will cycle through all the objects specified in the message. Still not too ideal though. There was also a suggestion to make the message window into a two-pane reader similar to e-mail clients like Thunderbird. I really like the idea and it's definitely on my list of goals.<br /><br />Fixed the move order in TP's Reach for the Stars (RFTS) ruleset. The problem was that move orders are implemented differently in Minisec and RFTS, one uses absolute coordinates while the other uses object ids. Order parameters are something I will be talking more about later.<br /><br />Display a radial menu using CEGUI widgets. The circular background is a static image, while the buttons are created in code and arranged in a circular pattern around the center. The menu is currently toggled with the spacebar, and I shall have to find a way to activate it via the mouse. Also, it does not follow the object when the screen is moved around, which is something I actually intended but looks a little weird in practice.<br /><br />Handling order parameters when sending new orders was pretty much the focus of the latter part of my week. Thousand Parsec has quite a few order parameter <a href="http://www.thousandparsec.net/tp/dev/documents/protocol3.php#OrderArgumentTypes">types</a>, and rulesets can mix and match them up however they like, so parameters have to be handled in as generic a way as possible. Thus far, I have handled the following order parameters:<br /><ul><li>Time</li><li>Object</li><li>List</li><li>Absolute coordinates</li><li>String</li></ul>I haven't done the rest because I've not been able to find orders which use those parameters yet. Anyway, to implement these parameters, I had to create a new widget for each new parameter I found. I first drew up the widget layout to act as a template and hid the widget upon runtime. Then, I made a copy of the widget as needed and placed them inside a ScrollablePane, a useful CEGUI widget which allows it's content to be scrolled.<br /><br />Finally, handling list parameters is a little different from the other parameters. This is because while other parameters can take in a generic set of values, lists only take in values from a limited set of options which are defined by the type of object selected. This requires creating the order first using some default parameters and sending it to the server. After that, the server will return the order populated with the options, which I can then use to show the user. After selection, the order with the user's selections is sent to the server to "overwrite" the initial order. This has the habit of creating "phantom" orders filled with default options when the client updates while the user is still filling in the order.<br /><br />Now it's time for the strange problems section. :)<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEAlfgfgcOgn3WnnbnC0q3Erp8kN_gIxA8DqcqS0bTQT7Ql33GF5tc1-gH135FTAgD1w61SXq1yAQcKHwu-XJbS5ZtybBHU6mC-B57Lr7Me3JP3dsZS6oS6xewbTfArNbLrp_4TuaHF1cy/s1600-h/screenshot_1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEAlfgfgcOgn3WnnbnC0q3Erp8kN_gIxA8DqcqS0bTQT7Ql33GF5tc1-gH135FTAgD1w61SXq1yAQcKHwu-XJbS5ZtybBHU6mC-B57Lr7Me3JP3dsZS6oS6xewbTfArNbLrp_4TuaHF1cy/s400/screenshot_1.png" alt="" id="BLOGGER_PHOTO_ID_5212298557034652034" border="0" /></a><br />Some messages use html tags which are not supported at the moment. There's also a unwelcome gradient in the horizontal scrollbar now that I look at it.<br /><br />RFTS is still not playable yet. The problem is mainly with the lack of ship design support, which RFTS requires to build even your first fleet, but there are also some usability issues such as not showing which turn it is as RFTS allows different kinds of orders depending on the current turn.<br /><br />Still no nice way to colour the fleets and indicate which planets are your own. I might go with some kind of overlay over the objects containing the player's name.<br /><br />Code structure. Under the hood, the code contains a lot of method calls which violate the <a href="http://en.wikipedia.org/wiki/Law_of_Demeter">Law of Demeter</a>, in other words many classes have intimate knowledge of the structure of other classes and "reach through" them to get the things they need. I'm not sure if this is actually something particularly bad, but it is an eyesore. Also, there is a small amount of duplicated code which I have to remove as well.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-83524340506871708712008-06-12T20:55:00.000-07:002008-12-09T01:44:16.845-08:00Sending orders via a menuMy focus this week is on sending orders with the tp client, so that I can actually play with it.<br /><br />After some discussion with mithro and greywhind, we felt that having a <a href="http://www.piemenus.com/">radial menu</a> would be a good fit for the client. I have only implemented a few orders, as shown below.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqD9eRcYohkwGh9gFh_D3DLAz-s3WbE7rgjJoTRkOmRLhOuGHdms2hyixAe-WvGZAnc5XIOhLTg5s39dGZDuKwjzZMLztcW-CJ9Eeq_obecXzBbmzkl8i44UCqXlqCOr5fSEWAQSCxYIok/s1600-h/screenshot_1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqD9eRcYohkwGh9gFh_D3DLAz-s3WbE7rgjJoTRkOmRLhOuGHdms2hyixAe-WvGZAnc5XIOhLTg5s39dGZDuKwjzZMLztcW-CJ9Eeq_obecXzBbmzkl8i44UCqXlqCOr5fSEWAQSCxYIok/s400/screenshot_1.png" alt="" id="BLOGGER_PHOTO_ID_5211210909393493570" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8fBLGyHIabvYdqRwVxM1XvhAPXZ5fif5btvAD7WVdZaX6_ANAJXQAphuxOBD9vDYlDcGp2bxb3fBx_zXuDWvvOk7Ikj6y235g3SK-9ChxPA9lLKOEvuTAsd-JsLTJ6NbGn9YMnWdPU98U/s1600-h/screenshot_3.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8fBLGyHIabvYdqRwVxM1XvhAPXZ5fif5btvAD7WVdZaX6_ANAJXQAphuxOBD9vDYlDcGp2bxb3fBx_zXuDWvvOk7Ikj6y235g3SK-9ChxPA9lLKOEvuTAsd-JsLTJ6NbGn9YMnWdPU98U/s400/screenshot_3.png" alt="" id="BLOGGER_PHOTO_ID_5211214145920453314" border="0" /></a><br />Pressing spacebar brings up the orders menu (if there are any) for the currently selected object.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPXY9nOXAb2_v_025OG-Exyq0EzszbL7_zH7PA-gmnArzMEuqsfE0axK-2SN2P1LmDa8JSzLu0mCXgq6vmPmlGQExB0UGnpv4XzOxNU8y9nPUD7MKKe9LKwNOdRPNyb4GhsB5zo2-1GqPC/s1600-h/screenshot_4.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPXY9nOXAb2_v_025OG-Exyq0EzszbL7_zH7PA-gmnArzMEuqsfE0axK-2SN2P1LmDa8JSzLu0mCXgq6vmPmlGQExB0UGnpv4XzOxNU8y9nPUD7MKKe9LKwNOdRPNyb4GhsB5zo2-1GqPC/s400/screenshot_4.png" alt="" id="BLOGGER_PHOTO_ID_5211212986436617762" border="0" /></a><br />Clicking an order shows the parameters for that order. If there are multiple parameters a scrollbar will appear. For orders that take in a list of arguments, I'm unsure how to get the list of available options.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9URNhnaH87beth7yMaLcyDigBDrqQcseDB_XCNahumHRi8Uue1I0-v-ZxlFkSTyEahCOFSdI2Dntkedi1a3vpNySRV-tjwRO6Z7krj5fM-Ff2kLIPG8bwYgUbtJfAgu4O93J6FDIVyeP2/s1600-h/screenshot_7.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9URNhnaH87beth7yMaLcyDigBDrqQcseDB_XCNahumHRi8Uue1I0-v-ZxlFkSTyEahCOFSdI2Dntkedi1a3vpNySRV-tjwRO6Z7krj5fM-Ff2kLIPG8bwYgUbtJfAgu4O93J6FDIVyeP2/s400/screenshot_7.png" alt="" id="BLOGGER_PHOTO_ID_5211214394431587122" border="0" /></a>Build fleet window with empty options box. :(<br />Once I am able to get the list of options, there shouldn't be any problem in sending the build fleet order. Moving a fleet is already ok, as shown here:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9QWBFUVa4L1wj1P1Mxjp41Pu2P0O2I2bhpaB7MKGLDCON2jcwuscwuI4A6Fxchm68cUVCdUix-AfvWFVZYzzA2zDAxsFI_yRd494wWMX2TQT0xjBw9zyMZpC7og251Sjn4PUCljd0xJRI/s1600-h/screenshot_5.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9QWBFUVa4L1wj1P1Mxjp41Pu2P0O2I2bhpaB7MKGLDCON2jcwuscwuI4A6Fxchm68cUVCdUix-AfvWFVZYzzA2zDAxsFI_yRd494wWMX2TQT0xjBw9zyMZpC7og251Sjn4PUCljd0xJRI/s400/screenshot_5.png" alt="" id="BLOGGER_PHOTO_ID_5211215549451554530" border="0" /></a><br />List of bugs in the program<br /><ul><li>Some of the stars in RFTS (Enif and Sabik) appear too close together.</li><li>Selection box not visible at a distance</li><li>Selection box does not follow the ship after an update</li><li>Order queue not update immediately after sending an order (must wait for update)</li><li>Network thread crashes while updating if the client is accessing some cache stuff simultaneously<br /></li></ul>Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-43065191150089481192008-06-05T09:57:00.000-07:002008-12-09T01:44:17.532-08:00Screenshot tourToday, I wanted to try my hand at colouring the fleets. This would allow the player to differentiate his forces from the enemy's. I also thought this would be a good opportunity to try and learn shader programming. I found an excellent resource: Nvidia's Cg <a href="http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter01.html">book</a>. But, after doing a few chapters I felt it would take too much time to learn and I wanted to have something to show by the end of the day. What I did instead was to edit the diffuse colours of each ship to match the player:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpiZng8xVT6fWq4DHx-yGICo7kPUwSmFqsLDwyi8TlWabQ4t4F8mfY2D7k4uq-TTlv_3apc6UyaXFRcQr_dfHOzH5DgTeUYUiF-FiwrpL0KlwZLKUzhu8vS3kBLPIpTU6lMFz-3QguGKbu/s1600-h/screenshot_19.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpiZng8xVT6fWq4DHx-yGICo7kPUwSmFqsLDwyi8TlWabQ4t4F8mfY2D7k4uq-TTlv_3apc6UyaXFRcQr_dfHOzH5DgTeUYUiF-FiwrpL0KlwZLKUzhu8vS3kBLPIpTU6lMFz-3QguGKbu/s400/screenshot_19.png" alt="" id="BLOGGER_PHOTO_ID_5208442856032095682" border="0" /></a>This shot is using Epyon's ship models. :) The little green ship orbiting the Terran-class planet is a scout, and those beefier types orbiting the star are frigates. Here's what another player's fleet looks like:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghopMrYExN9nqtqIB9m0ToZj_p2BqKJVbTpFzErSuOwcy4oRt3C-1BMl5TH1G8GKu-grVtj4GMdTj0JuUzN_DcpB6pAuXHLR3pfPPTzvjTzQ0sb0A5sQGNsoQDb-48KWdp_klItnOUJsMu/s1600-h/screenshot_20.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghopMrYExN9nqtqIB9m0ToZj_p2BqKJVbTpFzErSuOwcy4oRt3C-1BMl5TH1G8GKu-grVtj4GMdTj0JuUzN_DcpB6pAuXHLR3pfPPTzvjTzQ0sb0A5sQGNsoQDb-48KWdp_klItnOUJsMu/s400/screenshot_20.png" alt="" id="BLOGGER_PHOTO_ID_5208444157407186386" border="0" /></a><br />At this point, I realised that colouring the entire ship made it look a little weird, since most sci-fi ships are made of grey metals. The approach taken by most strategy games is simply to have different models for each player, or to colour certain parts of the model only. Anyway, I decided to take off the colours and just explore the system.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv0MDPryMdHUNo1NrM8F5p3b2GVQnm_gyLOwup7R_lnK-sMH9njeVD9yUVaNa15IfZQxVpySZB_Znf_ztaZOscnQIdiMh-4BxH_mJVv7erKLK74Z9yKrmrZS-s4UE8qvhrSMRs_F9PY7Hd/s1600-h/screenshot_21.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv0MDPryMdHUNo1NrM8F5p3b2GVQnm_gyLOwup7R_lnK-sMH9njeVD9yUVaNa15IfZQxVpySZB_Znf_ztaZOscnQIdiMh-4BxH_mJVv7erKLK74Z9yKrmrZS-s4UE8qvhrSMRs_F9PY7Hd/s400/screenshot_21.png" alt="" id="BLOGGER_PHOTO_ID_5208444320615943650" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkz2jAk8lUrxY8UCY_P-HHEF2MCNvIRRra9UhWliBQxCX9CKRan1LqQkxO7qEQbN97U8xSK9dLNa2hFmxbqztZ3oZfRcWMqeCV7U__9NyMj4Bb7-SrgnAezWcDgJ5IcEkXtMRyRRz21p-V/s1600-h/screenshot_22.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkz2jAk8lUrxY8UCY_P-HHEF2MCNvIRRra9UhWliBQxCX9CKRan1LqQkxO7qEQbN97U8xSK9dLNa2hFmxbqztZ3oZfRcWMqeCV7U__9NyMj4Bb7-SrgnAezWcDgJ5IcEkXtMRyRRz21p-V/s400/screenshot_22.png" alt="" id="BLOGGER_PHOTO_ID_5208444522479406578" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUitwlc56udfR2fd2QGZwGTWlD8iTDozeceu-IztLYRyyLcB7ehe2WMjWiw_z8RGBSPYyyIMwvnETKYrRI7DO9vnjoXq729QarLdQs1c6ySuGVnEWS2kZYZhN6qqG9NOzORuHI68QjtsMv/s1600-h/screenshot_23.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUitwlc56udfR2fd2QGZwGTWlD8iTDozeceu-IztLYRyyLcB7ehe2WMjWiw_z8RGBSPYyyIMwvnETKYrRI7DO9vnjoXq729QarLdQs1c6ySuGVnEWS2kZYZhN6qqG9NOzORuHI68QjtsMv/s400/screenshot_23.png" alt="" id="BLOGGER_PHOTO_ID_5208444668508294658" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOd8WVjWvenjoZM7JIrEQj5YPy2Kp7DM0HeqVToyzAqM7r8gxiAJHEeMtMMxjt2lYrafVgRhf2vPan03VjoYutMQwXaiXtufQJvHzAwh97jZ1rsED-DBiREFHiR9On6XCGcz8H82tPdQCF/s1600-h/screenshot_24.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOd8WVjWvenjoZM7JIrEQj5YPy2Kp7DM0HeqVToyzAqM7r8gxiAJHEeMtMMxjt2lYrafVgRhf2vPan03VjoYutMQwXaiXtufQJvHzAwh97jZ1rsED-DBiREFHiR9On6XCGcz8H82tPdQCF/s400/screenshot_24.png" alt="" id="BLOGGER_PHOTO_ID_5208444767292542482" border="0" /></a>Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-13137536870268600032008-06-04T19:47:00.000-07:002008-12-09T01:44:17.945-08:00Red herringsI got a little distracted by some issues yesterday.<br /><br />The first was the sphere mesh I was using for planets and star objects. No matter what texture I applied to it nothing would display on the surface except for the general colour of the texture. For some reason I decided it would be cool to generate a sphere in code using the "create a sphere" code snippet. It cost a bit of time to adapt the code and finally I got stuck at the part using pointers anyway. What I did in the end was to create a new sphere mesh in blender with the texture coordinates applied.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjahC_xz7KijvQtxWgkbgcPXQqHu7BSla8yTC-cKzHI0Oek50yTkrKiRfBJqOVymjH9deJhAli1ine7YnfrxPJl2HRTzlo-zljqDEGuXBcx7BihYoNn3zoeA-U8aNRViYF8xfjfKMlvcdZt/s1600-h/screenshot_8.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjahC_xz7KijvQtxWgkbgcPXQqHu7BSla8yTC-cKzHI0Oek50yTkrKiRfBJqOVymjH9deJhAli1ine7YnfrxPJl2HRTzlo-zljqDEGuXBcx7BihYoNn3zoeA-U8aNRViYF8xfjfKMlvcdZt/s400/screenshot_8.png" alt="" id="BLOGGER_PHOTO_ID_5208226106212535698" border="0" /></a><br />Here's the stars and planets with a texture (from vega strike again!) applied. It is very faint, but the "glow" of the star has an issue as well: it runs into the image border and looks cropped. Once again, I spent time fooling around with different image formats and Ogre's scene blending options to try and fix the problem. I also tried creating flares with a transparent background but Ogre doesn't like that, it requires a black background instead. The cause and solution was found in this forum <a href="http://www.ogre3d.org/phpBB2/viewtopic.php?p=255588&highlight=&sid=ce193664e1d3d7c4af509e6f4e2718c6">thread</a>, which is to adjust the levels and make the outer glow invisible.<br /><br />So anyway, I was trying to create a selection boundary around the selected object, and came across this cool <a href="http://www.ogre3d.org/phpBB2/viewtopic.php?p=194816">thread</a> detailing the use of stencil buffers and render queue listeners. After a while, I had adapted the code over to python but found what seems to be a bug in python-ogre: RenderQueueListener methods require a return value which is a pointer to a c++ bool object. Even with a listener stripped of all code it would still have the error, and I'm not sure how to create a c++ type. This might have been <a href="http://wiki.python-ogre.org/index.php/Python-OGRE_v1.2_Release_Notes">fixed</a> in the latest Python-Ogre, but compiling that is quite a chore.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMN_7cqdKlNNLwuENI0XgPeok5ljAxQ9Slb3rZ1UNm7HroyQo7inb2qB4WMrDsaW4bwrpMsuhYnHjw_1yO6BFCcTW8tOLkXf7B4E1DwUKc9pgfLra214xa6qKFOLpgHUCh3yiK7uIDls1X/s1600-h/screenshot_11.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMN_7cqdKlNNLwuENI0XgPeok5ljAxQ9Slb3rZ1UNm7HroyQo7inb2qB4WMrDsaW4bwrpMsuhYnHjw_1yO6BFCcTW8tOLkXf7B4E1DwUKc9pgfLra214xa6qKFOLpgHUCh3yiK7uIDls1X/s400/screenshot_11.png" alt="" id="BLOGGER_PHOTO_ID_5208237895897763234" border="0" /></a><br />What I went with in the end was a simple billboard pasted over the selected object, which is still better than using the bounding box. I'm currently wondering if this sun, with the glow exposed, is more 'sunny' than the previous one.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj7_WNUt_sxXoeeTOmQkPdXc2_95Ixnq8SzBdDCL0GKglRkMi2eh5PnV1zwH4thNMdPOT-7qoYlyFeCA1l9713k7bfsZRiGInwYHA9_0nD4tJSl74IoG86TlQINlCaVD1-7y1XkVsuP6l8/s1600-h/screenshot_18.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj7_WNUt_sxXoeeTOmQkPdXc2_95Ixnq8SzBdDCL0GKglRkMi2eh5PnV1zwH4thNMdPOT-7qoYlyFeCA1l9713k7bfsZRiGInwYHA9_0nD4tJSl74IoG86TlQINlCaVD1-7y1XkVsuP6l8/s400/screenshot_18.png" alt="" id="BLOGGER_PHOTO_ID_5208239914532392370" border="0" /></a><br />After adding a few different types of planets and stars.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-76724108244761154072008-06-02T19:36:00.000-07:002008-12-09T01:44:18.274-08:00Ship Models<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxjiAypJy0HX_gqbfpCCEhF9gdMZwDu8atOI8KktF9IMye40nHTeYmr4hCDKZhIdOan2xuQID9DQgHykzA4Z_DF_x3vsqKqWoU1S_dbvcU0uJf5g9WrcBkKt-aR2OcGphJ65aUA7EX8eNN/s1600-h/screenshot_5.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxjiAypJy0HX_gqbfpCCEhF9gdMZwDu8atOI8KktF9IMye40nHTeYmr4hCDKZhIdOan2xuQID9DQgHykzA4Z_DF_x3vsqKqWoU1S_dbvcU0uJf5g9WrcBkKt-aR2OcGphJ65aUA7EX8eNN/s400/screenshot_5.png" alt="" id="BLOGGER_PHOTO_ID_5207488114171333058" border="0" /></a><br /><br />A huge debt of gratitude goes to the <a href="http://vegastrike.sourceforge.net/">Vega Strike</a> project, this model is from their upcoming Ogre port. I think this model would be good for a 'scout' class ship.<br /><br />Actually, Thousand Parsec does have it's own talented modeller, Epyon, and his work can be viewed <a href="http://svn.thousandparsec.net/cgi-bin/viewcvs.cgi/media/concepts/ships/">here</a>. (Check out the cool concept art as well!) However, I encountered difficulties in bringing over the meshes from the .max format. Since I don't have that software, I had a friend to convert it to ogre for me. Portions of the model would disappear and also I was apparently missing some textures. I think these are all just temporary problems, and with a little effort they will be ready to roll as well.<br /><br />Going back to the 'Scout' model, I found that scaling it in proportion to the planets would make it lose a lot of detail, so I will try scaling the size of all objects up to allow further zooming in.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhorBwvaMckN0ZDkwGEC8LCY6Ln_PTI1DRUIzStbkwotSn6kHKuGvauTLBuGow7tBFZmGDGSVZoEQVW3DflSiTaIcudbUvHn96DrTOqiFQdfKRfFPUt3u1j8WrDLw6ZcyZqsW8HK4XfKVVH/s1600-h/screenshot_6.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhorBwvaMckN0ZDkwGEC8LCY6Ln_PTI1DRUIzStbkwotSn6kHKuGvauTLBuGow7tBFZmGDGSVZoEQVW3DflSiTaIcudbUvHn96DrTOqiFQdfKRfFPUt3u1j8WrDLw6ZcyZqsW8HK4XfKVVH/s400/screenshot_6.png" alt="" id="BLOGGER_PHOTO_ID_5207490575187593682" border="0" /></a><br />It's extremely faint, but if you squint (or click on the image) you can see the previous background has been replaced by a starry background. I hope to make it dynamic as well, in the sense that when you zoom in it will generate more stars further back, just like actual space. And other possibility would be to tweak the particle system so it generates clumps of stars with a <a href="http://gallery.artofgregmartin.com/tuts_arts/making_a_star_field.html">glow</a> to them.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com1tag:blogger.com,1999:blog-5359522288090977052.post-27504667192152293152008-06-01T07:09:00.000-07:002008-12-09T01:44:18.601-08:00Some updatesHere are the changes I have made to the thousand parsec client this week.<br /><br />Movement orders possible by selecting a fleet and right-clicking the destination. Finding out how to send orders in thousand parsec was an important milestone for me.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgix44uxnnFEIFZM8E1mCYbwGSWS0Uybh5DFKUwtKAchbctoUxuSVtxWUvJYvaQIDiHLeTgkbOp89M4TisQuFt6xxbJfG9iN0GPi4-kDODk26Jpdu1JAWmkWyzs0CfnY8bVefYIb-y1gKfL/s1600-h/screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgix44uxnnFEIFZM8E1mCYbwGSWS0Uybh5DFKUwtKAchbctoUxuSVtxWUvJYvaQIDiHLeTgkbOp89M4TisQuFt6xxbJfG9iN0GPi4-kDODk26Jpdu1JAWmkWyzs0CfnY8bVefYIb-y1gKfL/s400/screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5206926173535226226" border="0" /></a><br />Movement paths are indicated by a line. However, this does not remain when the turn updates. In addition, changing the destination will leave the old line behind. :( I will be getting to that shortly...<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd2TUVKF4wV7ONiYtkGPC_ALHCD00cYdMVG4DxJVhICrNrH5eotN4XoPuW3hgQkYfuKPkpNKOAW_mqHFgSeVH42TwYqslhkZs-EMzezx1FDZBYxHz8DRkNGO6sfjeqA6uEPTG9LEgHa9y9/s1600-h/screenshot_1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd2TUVKF4wV7ONiYtkGPC_ALHCD00cYdMVG4DxJVhICrNrH5eotN4XoPuW3hgQkYfuKPkpNKOAW_mqHFgSeVH42TwYqslhkZs-EMzezx1FDZBYxHz8DRkNGO6sfjeqA6uEPTG9LEgHa9y9/s400/screenshot_1.png" alt="" id="BLOGGER_PHOTO_ID_5206935261686024578" border="0" /></a>Able to delete messages. I would like the "Goto" button to center the map on the source of the event. For instance, a battle report message would go to the combat location. However I could not find any information in the message object passed by the server that might help. Currently, the message object has id, slot, type, subject, body, turn number and references as it's attributes, and clearly "references" would be a good place to look, but I found it empty no matter what the message. So, "goto" is still in progress. Also, I think a message count in the window title would be useful.<br /><br />Able to exit to the login screen and re-enter the same game. This was done by clearing all the resources and loading them upon re-entry. However, tpserver logs do not report a client disconnect, so I have find out how to do that before entering another game.<br /><br /><span style="font-weight: bold;">Some bugs I have encountered:</span><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVzPv6cYvHUWBTtPaygY9VKuJMZpLRuniMEqPiq8Q1Le1As-GL08c95jeUIrxLfi6LYKLK4RnW3X2P8VgUIewlRoABaCdO3g1qTVsRh8KwIn-hHTc0kIWptgdvlZ0nFVdqG5SJCd_K-jlP/s1600-h/screenshot_2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVzPv6cYvHUWBTtPaygY9VKuJMZpLRuniMEqPiq8Q1Le1As-GL08c95jeUIrxLfi6LYKLK4RnW3X2P8VgUIewlRoABaCdO3g1qTVsRh8KwIn-hHTc0kIWptgdvlZ0nFVdqG5SJCd_K-jlP/s400/screenshot_2.png" alt="" id="BLOGGER_PHOTO_ID_5206939380559661458" border="0" /></a><br />The mouse cursor is hovering over what is called a "CEGUI listbox" object. Since I am using it to show available orders for the selected object, it required removing the list and repopulating it whenever a new object was selected. However I found that it would segfault immediately upon removal of an object. Finally saw a method called "setAutoDeleted(boolean)" for listbox items in the api, which deletes the item automatically when it is removed from a list. After setting it to False I could then remove items without crashing. Hope that this helps other python-ogre cegui users out there, since the setting is on by default. My unqualified guess is that python's gc does not like objects deleting themselves automatically.<br /><br /><span style="font-weight: bold;">What's next</span><br />I have been giving some thought to improving the look of the client. I think it should be pretty clear that the current 3d models are all placeholder objects. I've found Vega Strike to be a rich source of 3d models, although I have only played the game a couple of times. Ideally, I would like to have different models for each ship class, but this might become ruleset-specific. So right now I would assign a ship model type to each player, so "Player 1" would always get a certain model and so on.<br /><br />Planet models should have a texture to them as well, but I'm wondering how to distinguish planets from one another. For instance, some planets could be "Terran" type, "Arid" type, "Acid" type and so on. In rulesets which don't supply such information, I would apply a generic planet type to prevent confusion.<br /><br />For stars, they ought to have a glow in addition to their texture. Actually mithro, who created the client, has already put in "glow" billboards, but they are not visible as I think I forgot to resize them.<br /><br />Currently it's not clear which ships and planets belong to each player, so they have to be differentiated somehow. I guess I could change the material settings for each fleet to colour them, but colouring planets would be weird. Perhaps I could change the colour of their text label, but I've already found some colours to be barely visible against the background. A better way would be to surround the planet with a coloured halo, because at least the player won't have to read it.<br /><br />The skybox currently being used for the background has to go as well. I will try a particle system of white dots with billboarded nebulae. Hope it looks better than it sounds. :)Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com1tag:blogger.com,1999:blog-5359522288090977052.post-9937301326738332602008-05-26T16:38:00.000-07:002008-12-09T01:44:18.830-08:00A status reportYesterday marked the official start for coding. Following my schedule, these are my features for this week:<br /><br />- Starmap will represent objects with different models<br />* Stars, fleets and planets can be distinguished from one another<br /><br />This is where the coding I've done beforehand comes in handy. Stars, fleets and planets can be distinguished already, using some <span style="font-style: italic;">extremely</span> primitive models.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-s7Wup00E2mua4iEfy2N7liuj6yCkyO92jrl74j4Q1hhUvy2FdxPDtmWNn7yQ3Xo4ZuLSN_zK44dmoSxQuRzoJA9C0a9KJJHHF0qQrGsKeF80TBzpFsn5DQB8KtMHJg7iu6S4yHIWuiq-/s1600-h/screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-s7Wup00E2mua4iEfy2N7liuj6yCkyO92jrl74j4Q1hhUvy2FdxPDtmWNn7yQ3Xo4ZuLSN_zK44dmoSxQuRzoJA9C0a9KJJHHF0qQrGsKeF80TBzpFsn5DQB8KtMHJg7iu6S4yHIWuiq-/s400/screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5204836637585983826" border="0" /></a>If you squint, you can still see the blueprint lines on those ships :). Those are my three fleets orbiting around the home star system. It is a bit close to the other star for my liking, but I'm not sure what to do about that. I guess I will add some colour tinting to distinguish friendly assets from the enemies (which is everyone else).<br /><br />- Client will show a message window<br />* Able to scroll, flip through messages and delete them.<br />* A Goto button will center the map on the object related to the message.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj75O0SGa0D4xx9fjOE6p630NMmALqzFlqId3rBUf9LqksMWCkjBesvZBHrxACjBoauOeU3c4nGTUJ2uce5BqB_3tpo01R2OkcCV-y-43JckGdj2f04bYClMCWoYwwQsGk9SoAIa6jCJgKP/s1600-h/screenshot_2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj75O0SGa0D4xx9fjOE6p630NMmALqzFlqId3rBUf9LqksMWCkjBesvZBHrxACjBoauOeU3c4nGTUJ2uce5BqB_3tpo01R2OkcCV-y-43JckGdj2f04bYClMCWoYwwQsGk9SoAIa6jCJgKP/s400/screenshot_2.png" alt="" id="BLOGGER_PHOTO_ID_5204837994795649378" border="0" /></a>So far, I have implemented some of the windows already, based on how the existing tpwx client works. Since the messages window can flip through messages using "Next" and "Prev", I will be adding a goto button and delete button as well. I guess I'll have to resize those existing ones.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-57890385591581222072008-05-26T16:16:00.000-07:002008-05-26T16:38:52.492-07:00A bit of sillinessI spent a lot of time reading through the tpclient-pywx code and tp's client libraries to figure out how a client sends code. This line under StateTracker's ChangeOrder method threw me off for a while:<br /><br /> evt = self.application.cache.apply("orders", "change", self.oid, node, order)<br /><br />I guess the function of the cache object is rather self-explanatory. It is found in the tp client library, and stores all of the universe objects which has been very handy for getting object properties so far. Thinking I could use the cache.apply method to send orders (my reasoning was that when cache is changed it will notify the server automatically) I tried adding this to my code. However, nothing happened and I couldn't figure out an alternative approach and instead kept combing through the same code over and over to look for any mistakes.<br /><br />When I tried downloading all the alternative clients I found the answer in the text-based python client. The code is spread over two files only, and immediately reveals that the Connection object should be used instead. It contains all the methods (such as insert_order) necessary to make things happen.<br /><br />I guess the lesson learned here is to look for simple alternatives before going deeper down a chosen path. Since the tpwx client and tp client libraries have a very large code base, I should have made sure there were no other choices first before delving in.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-37107399115098047192008-05-20T05:36:00.000-07:002008-05-20T05:59:09.064-07:00Taking a little breakRight now, I'm on a rather impromptu vacation in Sydney. I'll be back on Sunday.<br /><br />Thinking I could make commits on the go, I copied my ssh keys over to the laptop which I lugged all the way here. Unfortunately, it seems that the tp server rejects any commits not from the original machine? I'm not too familiar with ssh I'm afraid.<br /><br />Currently, I'm trying to send orders to move the fleets around, but how to do that is still not obvious to me. I've read the tp03 protocol and skimmed through the tpwx client code already, but the real problem is that the weather is really great for sightseeing, even at night (which starts at 5+ p.m.). Internet access around here is a little hard to come by as well. What I wouldn't give for some of Singapore's island-wide wifi right now :)<br /><br />On the GSOC front, it seems that Google has now sent out the mystery book via Fedex to all the students. I haven't read any blog posts since then for fear of spoiling myself.<br /><br />On one hand, I can't wait to get back to Singapore and code, on the other, it really is rather nice here...Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0tag:blogger.com,1999:blog-5359522288090977052.post-89298243235609153072008-05-12T19:22:00.000-07:002008-12-09T01:44:19.579-08:00Rendering of stars and fleetsOne design issue I've run into is how to display planets and fleets in relation to star systems. Thousand Parsec uses incredibly large distances when positioning the stars in order to give a sense of scale to the game. In order to fit everything reasonably close together for the player, I've scaled down these distances. It works decently for star systems, but when it comes down to individual planets, they appear right on top of their parent systems due to scaling.<br /><br />There are a few approaches I could try to solve this problem<br /><br />1. The tpclient-wx approach<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglZfwV4LFqx8drHVd5d2MNYTX0dw-SkJSpUS1SE2A-oTfm53njDQ7ZZSTwzlYjePXvAlcEtITcUnq_z3XCjJEPMtOgkpiYkZdseLoJ8sciXD0GEfnx1XencY5fOxLyK1mlU3gKzVohyphenhyphenX43/s1600-h/tpwx.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglZfwV4LFqx8drHVd5d2MNYTX0dw-SkJSpUS1SE2A-oTfm53njDQ7ZZSTwzlYjePXvAlcEtITcUnq_z3XCjJEPMtOgkpiYkZdseLoJ8sciXD0GEfnx1XencY5fOxLyK1mlU3gKzVohyphenhyphenX43/s400/tpwx.png" alt="" id="BLOGGER_PHOTO_ID_5199685236400036866" border="0" /></a><br />The flagship client of Thousand Parsec draws both fleets and planets as dots in a circle around their star systems. This would involve ignoring their individual locations and drawing them in an arbitrary position around the star.<br /><br />2. The GalCiv 2 approach<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc4BkGtBQIou3muGcg58-LWJ_3F1XYHLbqBkglEehl72gjvi2SThpHHhYs5Owf1DNprfH23akI2oF1H15_8l1-t9WSSvoltDo45fBhTcEWAJE8vGhhGJ-EaFcFRZ_hkJHlE2SJ5weKOL1e/s1600-h/galciv.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc4BkGtBQIou3muGcg58-LWJ_3F1XYHLbqBkglEehl72gjvi2SThpHHhYs5Owf1DNprfH23akI2oF1H15_8l1-t9WSSvoltDo45fBhTcEWAJE8vGhhGJ-EaFcFRZ_hkJHlE2SJ5weKOL1e/s400/galciv.png" alt="" id="BLOGGER_PHOTO_ID_5199686975861791762" border="0" /></a>Galactic Civilisations 2 draws planets and fleets in a semi-realistic manner. What I mean is, planets are out of proportion and now that I think of it, it appears that all the planets have an equal distance from the sun. So this is not really a different approach from the above, the only difference is that fleets can move around the system (not supported in TP).<br /><br />Image credit: <a href="http://www.galciv2.com/">GalCiv 2 site</a><br /><br />3. The MOO2 approach<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLlBC-dZvfJPdGttBIM34EfbGGWUEEQqRLclupoxTgeWmirE2xdjfKVUHbGgnU558rP83PrIC64cBO7_4_Mdzlk0wfxBU2pwoDWWWZTF_QO2UWSW3o7QYWuSAlWheuRujZv1-IJVOeGy9-/s1600-h/moo.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLlBC-dZvfJPdGttBIM34EfbGGWUEEQqRLclupoxTgeWmirE2xdjfKVUHbGgnU558rP83PrIC64cBO7_4_Mdzlk0wfxBU2pwoDWWWZTF_QO2UWSW3o7QYWuSAlWheuRujZv1-IJVOeGy9-/s400/moo.png" alt="" id="BLOGGER_PHOTO_ID_5199689883554651170" border="0" /></a>Master of Orion 2 draws star systems and fleets on the map - no planets. To view planets, one has to click on the system which brings up a window showing the individual planets. Very elegant in my opinion.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5HYeR3nxjrfbwcxKxDGlhff9OswOVWTrPJ2Qsy1ProcwTKpMRL5bazKZwI5uDo0Mh2W7Q87sRACEyIA5_exJevlt84AJbIzFTDdRN3kp8_Lg9ts9dpfbKrPk1QlKQ_eHE01c-mDaS2qOU/s1600-h/moo2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5HYeR3nxjrfbwcxKxDGlhff9OswOVWTrPJ2Qsy1ProcwTKpMRL5bazKZwI5uDo0Mh2W7Q87sRACEyIA5_exJevlt84AJbIzFTDdRN3kp8_Lg9ts9dpfbKrPk1QlKQ_eHE01c-mDaS2qOU/s400/moo2.png" alt="" id="BLOGGER_PHOTO_ID_5199691511347256370" border="0" /></a>Here is another shot of how systems are drawn in relation to fleets.<br /><br />Image credit: <a href="http://www.mobygames.com/game/windows/master-of-orion-ii-battle-at-antares/screenshots">Mobygames</a><br /><br />4. Another method would be some kind of dynamic map which changes in detail as you zoom in and out (Homeworld style).<br /><br />I guess this post has really been a thinly veiled excuse to post some nice screenshots from other games. :) Now back to work!Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com1tag:blogger.com,1999:blog-5359522288090977052.post-75698315522983095372008-05-05T22:30:00.000-07:002008-05-05T22:54:02.382-07:00TPServer updateThere was an update of tpserver to 0.5, which is a big update and includes the Reach For the Stars ruleset. RFTS offers a more substantial ruleset for thousand parsec and is based on the actual <a href="http://en.wikipedia.org/wiki/Reach_for_the_Stars_%28computer_game%29">game</a>. Sadly, I missed out on playing this game before, but no more! I wonder if there will be a MOO or Spaceward Ho! ruleset too. :)<br /><br />I was trying to compile the server on my system, when I started to get errors all over the place. Then I went back to try compiling 0.4.1 and failed too, so I knew I had probably had some issues with my system configuration.<br /><br />Later while chatting with the devs, I found that the cause was due to me running gcc 4.3 while the devs were using 4.2.3. With the handy <a href="http://gcc.gnu.org/gcc-4.3/porting_to.html">porting guide</a>, I compiled the server successfully but found that all I needed to do was to add some #include statements. If only all my problems would be this easy.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com1tag:blogger.com,1999:blog-5359522288090977052.post-1183110952499151692008-05-05T22:12:00.000-07:002008-12-09T01:44:19.835-08:00SleekSpaceOver the weekend, I found a nice <a href="http://skins.cegui.org.uk/">CEGUI skin</a> for the client. When I first downloaded it, it was strangely missing a lot of property tags needed to work correctly, such as text colours and one of the frame borders not showing up. Not sure if I managed to get the same look as the original, but at least I learned a little about the <a href="http://www.cegui.org.uk/FalDocs">Falagard</a> skinning system in the process. I'm guessing there are still missing property tags since I haven't tried all the widgets.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgswZWgMnGw3bInLaV8N9DNhC2bb4GvYEp-jNZkhTZb50S2VVpU_lRqpCSK-K9navvMOl86Z3XyEauU7-7n5ZcJGC2YR-oZp8-I193-OkJUBLjituVIDAMGE_Em9Cjcrmq6QNgWPZUNi4rC/s1600-h/screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgswZWgMnGw3bInLaV8N9DNhC2bb4GvYEp-jNZkhTZb50S2VVpU_lRqpCSK-K9navvMOl86Z3XyEauU7-7n5ZcJGC2YR-oZp8-I193-OkJUBLjituVIDAMGE_Em9Cjcrmq6QNgWPZUNi4rC/s400/screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5197130312648671042" border="0" /></a>I thought I would try some simple layouts to see how the main gui might look, then I ran into some problems with the star system labels.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia7P4giPDpPMSLR9IVrrRc7tAe6tgt3TNvRWherRB8tkfrH153Kdnlxn1y7FGxnNjhPnFTf9SguzCf-bEeO66ngp-pSI3rwz8bjhn_IppAnvTO7BtFCDoAgzICqZeF1dLERaKg-Gr0N5XF/s1600-h/screenshot_1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia7P4giPDpPMSLR9IVrrRc7tAe6tgt3TNvRWherRB8tkfrH153Kdnlxn1y7FGxnNjhPnFTf9SguzCf-bEeO66ngp-pSI3rwz8bjhn_IppAnvTO7BtFCDoAgzICqZeF1dLERaKg-Gr0N5XF/s400/screenshot_1.png" alt="" id="BLOGGER_PHOTO_ID_5197131287606247250" border="0" /></a>Looks like the GUI blocks out the star objects correctly but not the text overlays. I'll have to look into how OGRE's overlays work. Once the rendering order is sorted out, I'll start to look into how I can retrieve information(messages, system information, etc) using the tpclient library.<br /><br />edit: <a href="http://www.cegui.org.uk/phpBB2/viewtopic.php?t=152&highlight=overlay">Looks like</a> I just had to change one parameter from False to True when creating the CEGUI renderer.Eugene Tanhttp://www.blogger.com/profile/06392951286424003935noreply@blogger.com0