Wednesday, July 16, 2008

wxPython Integration

Finally uploaded some new stuff.

Two more 'main' files.

One has the game running inside a basic wxPython window.

Another extends the AUI Docking Window Manager Demo as can be seen in the photo here.

Wednesday, May 7, 2008

RoboCute Has Left The Building

I'm going back to doing C++ over at Botworx. Vacation is over!

Thursday, May 1, 2008

May 01, 2008


It's been 9 days since the last post so I guess I should write something.

Let's see ...

Refactored a ton of stuff.

Moved code into the __init__.py files that belong there.

Using OpenGL quads for the widget skins now. No more cracks while scaling, plus it's faster. Also started work on a DocWidget class for displaying help files, use as a console, etc.

Fleshed out the Catalog to include all the items from the PlanetCute tile set.

Right now I'm trying to implement persistence which will probably take the rest of the week, since I'll also need to come up with File Dialogs also.

That's it for now.

Tuesday, April 22, 2008

New Render Batching and Unified Front End

Rendering has been significantly sped up by batching OpenGL calls on a per terrain page basis. Thankfully pyglet has support for this kind of thing or I'd be up a creek. FPS ranges from 60 for closeups to about 10 - 20 for birds eye view.

The front end has been unified where it is possible to not only create avatars, but also take control of them by pressing the 't' key while the selector is over them when using the Designer. Pressing the escape key takes you back to the tool/avatar that you were using previously.

Still a long way to go though.

Friday, April 18, 2008

On to Better Things

Definitely, this paging stuff is getting boring.

Short story fast ... I put the page caching into a Clip class that the rendering process uses. When the Clip crosses a page boundary I just update the current page location and invalidate the cache. The cache is set at 3x3 but can be any size really.

This results in seamless traversal of the World.

This means it's good enough to move on to other pressing needs such as AI, the user front end and more efficient rendering.

Better things to come!

Wednesday, April 16, 2008

Where's Waldo?

Yes, yes. The back end is getting there.

The program as it is now can infinitely tile, but now I have to work on the camera code to shift the page map.

Then it's back to the front end which is the AI/user interface code, since I have some new ideas to clean that mess up.

After that I'm going to work on improving the frame rate. As you can see it's not too hot on this zoom level. Decent at 1:1 though.

Time to commit!

Slow and Steady

Well, the slow part is right. Steady is coming, eventually.

Making the move to a paged world opens up a lot of possibilities and a lot of headaches.

The picture was supposed to be full of treasure, but only one of the treasure bots ran. That's an easy fix. I just wanted something to slap on the blog even if it's not perfect.

Back to work.

Tuesday, April 15, 2008

Reconstruction

There is some major reconstruction going on.

No paging terrain yet but I'm working on it.

I've got things going in a more document/view direction now.

Too busy to tell more!

Monday, April 14, 2008

Paging Terrain

This is going to be a pain.

Alright then. I created GridPage and GridPageVu classes that take over the functionality that the Scene class was providing.

This means it's possible to have multiple pages right now.

I just need to figure out how caching and indexing is going to work.

Hmmm.....

Designology

Wow, I've got a full head of steam going now!

I reworked the GUI code where it's starting to look like a real widget framework.

We now have a catalog with multiple pages.

All the zoom issues have been worked out, there just remains a problem with tiling where you see hairline fractures between the tiles when the scale is not 1:1. There's a rounding problem afoot. Maybe I'm supposed to tile to a framebuffer first, and then blit?

When it came time to write classes for all of these new items in the catalog, I thought 'There has got to be a better way!'

So instead of writing a class for each item, there will exist only one class for multiple items of a similar category. For the blocks, landscape and treasure this really makes sense.

As you can see, I decided to go the spreadsheet route again to define the catalog. It works pretty well, just property/value pairs in a row.

The catalog reader is able to instantiate a class, pass the item that was used to create it and also assign attributes on the fly!

This means that it will be possible to create new catalog items by mixing and matching different classes. Say, you want the Boy with a different brain, or with a different image, or whatever.

Okay, I have got stop putting off committing this darn thing to SVN. If you download it just realize it's only two weeks old!

Sunday, April 13, 2008

Selectionology

This is a lot of fun but it's also a lot of work. If it weren't for Python and pyglet, I'd probably have thrown in the towel by now.

As you can see in the image I have multi-select working now. You can add to the selection with the Ctrl key and create selection ranges via the Shift key.

I still need to work on clearing selections, I guess using the escape key. Since I'm using escape for exiting the program I need to write code to change that behavior.

I modified the way catalog pages are displayed. I decided to scale the original images using OpenGL instead of manually creating thumbnails. Now I need to rewrite the code that calculates the page height taking the scaling into account. Centering also needs to be fixed.

Hopefully, I can pound this into some consistent form and then I'll commit to SVN.

Saturday, April 12, 2008

Zoom, Zoom, Zoom - Part 2

That was pretty simple to fix. I only had to upgrade the culling and the camera code. Other stuff like mouse picking works through OpenGL via unproject so no changes there. Sweet!

Zooming works through plus and minus on the numeric keypad.

I'm thinking it's time to do a commit to SVN even though this is in a haphazard state between 'Is it a game?' or 'Is it a game editor?'.

Zoom, Zoom, Zoom

It occurred to me that editing on a 1:1 scale would be impractical. So I inserted glScale(.5, .5, .5) into the pipeline as a test.

Looks sweet! Or, it will after I add all the necessary code to handle scaling properly.

I think it's probably time to look into rendering to a frame buffer also. This is really going to kill my frame rate!

Selector is Working

Five minutes after I made the last post I realized what was happening. I was repeating the same Cell across. The bug was in the spreadsheet reader.

As you can see I have the code rigged to where clicking an image deposits a block where the Selector is.

Work, work, work.

The Selector

After deep meditation, I decided that the Selector is a Robo, meaning a Character type class.

This way I don't have to add any extra code for navigation.

I was going to use the mouse to select blocks, but since blocks are singletons and therefore have no real coordinates, this was problematical.

Frustration

The picture to the right here shows a rendering bug I can't seem to quite figure out. Which is odd since all of this code is really simple!

Once the Selector walks onto an empty cell it gets redrawn across the screen. What's really odd is that if I move another cell to the right it's still repeating from the first blank cell across.

Using PyDev's debug mode doesn't reveal anything being abnormal. What gives?!!!

Friday, April 11, 2008

The Catalog - Part 2

I decided to attach the catalog page to the dashboard layer and fixed the dashboard layer to layout/draw multiple items.

I need more dash items like one to display the current item we are painting with.

Alright then. I've got enough to start with ...

Time to start doing some mouse action handling!

The Catalog

Python and pyglet makes for wicked fast progress!

Instead of getting carried away and trying to write a widget library from the bottom up, I'm just going to repurpose what I have and refactor later on.

Basically I took the Bubble code, copied, pasted and modified it to work in the vertical direction, resulting in a widget.List class.

I took the easy way out and repurposed the scene reader to read in catalog pages from a spreadsheet. Each sheet is a page in the catalog. Each row describes a catalog page item. Name, image, creation code, etc.

Now I need to generate thumbnail images for each item because the actual sprites are too big. Joy.

I also need to implement scrolling at some point.

Getting closer though!

Thursday, April 10, 2008

World Building

This seems like the logical next step since the spreadsheet method is getting old.

I'm not really looking forward to it though. It's going to be tough with a lot of nit picky details. Sounds too much like work!

The Catalog

Classes need to be written to implement a catalog of items with categories and subcategories. This catalog will be specified in XML.

The Categories

Too simple to elaborate on right now.

The Items

Each item element in XML will specify the item name, image and Python creation code as it is using the current spreadsheet method.

The User Interface

Luckily, I wrote an ultra simplified user interface in CEGUI for Botworx that I can copy, paste and modify.

The unlucky part is that I need to write something like CEGUI!

Final Thoughts

Too much like work.

Wednesday, April 9, 2008

Clean Up Time

Heh, that's what I tell my three year old nephew when it's time to put his toys away. Clean Up Time! Yay! Not.

Unfortunately, when you make a mess and actually care about what your writing it's necessary.

There was a bunch of Noob mistakes that needed cleaning up. Thanks to some kind people from the PyWeek competition I was able to take care of them in short order.

I was using tuples for block coordinates and transforms, now these are classes.

Basic dumb stuff that needs to be done. Boring!

Google App Engine

I found out about the preview release of Google App Engine while browsing Google News last night.

Rarely do I get excited about software releases of any kind. This one is different.

What can I say? Visit the link. This one is HUGE!!!