The Moosader Community
http://moosader.com/forum/

PoS code audit
http://moosader.com/forum/viewtopic.php?f=60&t=886
Page 1 of 1

Author:  Rachel [ Sun Jun 12, 2011 6:57 pm ]
Post subject:  PoS code audit

I'm doing an inspection of all the PoS code in the current project; for some reason, the game runs really freaking slow in my Ubuntu VM, and it CAN'T be all the VM because I have a 3D SFML/OpenGL project that runs smoothly under the VM.

So I'll write down notes as I step through.

I've gone through and set everybody to "Inactive" on the contributor list:
http://code.google.com/p/pickin-open-sticks/people/list

If anyone is interested in working on this project more, let me know.


Code Style

I don't like "Java-style bracketing"; ie
Code:
void Main() {
  // stuff
}

I'd prefer braces to be on separate lines:
Code:
void Main()
{
  // stuff
}

Author:  Rachel [ Sun Jun 12, 2011 7:35 pm ]
Post subject:  Re: PoS code audit

The game itself

The game itself is pretty unrefined; The GUI elements I'm seeing are pretty ugly... white text on off-white background, completely square and flat-colored.
Exit button randomly placed on the game field.

The stick seems to have some extra color to it, don't know why that is.

Image

Author:  Rachel [ Sun Jun 12, 2011 8:32 pm ]
Post subject:  Re: PoS code audit

Main

There is way too much stuff in main - The GUI stuff shouldn't be set up in there, and the GUI stuff is about 36 lines of code inside of main.

Inside the game loop, in the Game State switch,
Code:
mainWidget.Hide();
mainPlayWidget.Show();

Doesn't need to be ran every time, I assume.

Once the
Code:
map.Render(system);

is removed from the game loop, everything runs quickly.

Author:  Rachel [ Sun Jun 12, 2011 8:34 pm ]
Post subject:  Re: PoS code audit

Map

"Initialize" is misspelled.

Map::Render is being passed System&; it does NOT need the entire class!!

I tried rewriting the render function but I can't get it to speed up; I'm finding it odd that there are various things I can run in my ubuntu vm, and yet it can't render 19x25 tiles.


WIP

Author:  Rachel [ Sun Jun 12, 2011 8:52 pm ]
Post subject:  Re: PoS code audit

UI

I don't think I have time to step through the UI code tonight, but here's what I'm gathering, purely from looking at the files:

There are a lot of files. I think at this point, there are too many files for the point that Pickin' Open Sticks is at.

If we're going to integrate a sophisticated GUI into Pickin' Open Sticks, it should be developed outside of PoS and brought in later, either through importing the code or via dll.


For the time being, we might remove the UI code, if Sutabi sees fit.
I think it's partially getting in the way, because there's so much, and it will scare any new contributors away (too much to grok with, having to learn). Plus, it's quite complex and implemented before we set up any standards for branching or code writing standards.
I'd like to have a more functional and better looking UI developed before committing something partially written.

I do like that they're in their own namespaces.

Author:  sutabi [ Mon Jun 13, 2011 1:24 am ]
Post subject:  Re: PoS code audit

I've added a simple FPS count in the console, be interested on the frame rate.

Here is my netbook specs
Intel Atom N270 1.6 GHz Processor
512 KB L2 Cache, 533 MHz Front Bus speed
1024 MB DDR2 (PC2-4200) RAM
120 GB (5400 RPM) SATA Hard Drive
Intel GMA 950 graphics accelerator

The GMA has a 400Mhz processor and given that this game eats up 100% of my netbook's cpu I would say we are not using opengl very well. It would be better to use display lists, vertex buffers objects, vertex arrays

* I get about 24-30 FPS on my netbook.
* I created a clone and used a display list and get 30-60 FPS: http://code.google.com/r/sutabi-pickin-open-sticks/

Author:  sutabi [ Mon Jun 13, 2011 3:10 pm ]
Post subject:  Re: PoS code audit

So I ran it on my quad core work computer which should had mad this run like cake, but instead for 10 FPS.... So I disabled Unity from 11.04 and got 60 FPS. Are you running Unity with your Ubuntu VM setup?

Author:  Rachel [ Mon Jun 13, 2011 3:19 pm ]
Post subject:  Re: PoS code audit

sutabi wrote:
So I ran it on my quad core work computer which should had mad this run like cake, but instead for 10 FPS.... So I disabled Unity from 11.04 and got 60 FPS. Are you running Unity with your Ubuntu VM setup?


I'm running Ubuntu 10.10... That, or Ubuntu 11.04 w/ Gnome (or "Classic"?) I'll check when I get home, if I have time to tonight.

Author:  adikid89 [ Tue Jun 14, 2011 4:45 am ]
Post subject:  Re: PoS code audit

Moosader wrote:
UI

I don't think I have time to step through the UI code tonight, but here's what I'm gathering, purely from looking at the files:

There are a lot of files. I think at this point, there are too many files for the point that Pickin' Open Sticks is at.

If we're going to integrate a sophisticated GUI into Pickin' Open Sticks, it should be developed outside of PoS and brought in later, either through importing the code or via dll.


For the time being, we might remove the UI code, if Sutabi sees fit.
I think it's partially getting in the way, because there's so much, and it will scare any new contributors away (too much to grok with, having to learn). Plus, it's quite complex and implemented before we set up any standards for branching or code writing standards.
I'd like to have a more functional and better looking UI developed before committing something partially written.

I do like that they're in their own namespaces.

Yeah.. sorry that's the old gui, I haven't updated the PoS gui code. Now it's in a static library, and the ui is initialized from an .xml file... so it's cleaner :D.
I'll take care of that when I have some time.

Author:  Rachel [ Fri Nov 18, 2011 11:34 am ]
Post subject:  Re: PoS code audit

I'm actively refactoring the code right now.
Also, it was stupid of me to post PoS documentation in Google Docs and the forum rather than on the project page itself:
http://code.google.com/p/pickin-open-sticks/w/list

I have not yet merged the branch, I'm working on a refactor branch:
http://code.google.com/p/pickin-open-sticks/source/list?name=RefactoringPoS


I am refactoring it because of my Google Code projects, PoS gets looked at the most.
Page visits over the past year:
PoS: 2,342
Sader: 1,199
Farmer Duel: 757

So yeah, I'd rather the code be well structured and easily maintained and updated.

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/