*** tpb has joined #tp | 00:00 | |
*** ChanServ sets mode: +o tpb | 00:00 | |
tpb | tpb has joined on worldforge | 00:00 |
---|---|---|
mithro | still no dmpayton :/ | 00:50 |
mithro | DystopicFro: ping? | 00:58 |
mithro | nash: ping? | 01:02 |
nash | mithro: Going through the list? ;-) | 01:02 |
mithro | nah | 01:02 |
mithro | ~seen dmpayton | 01:04 |
tpb | mithro: dmpayton was last seen in #tp 4 days, 1 hour, 11 minutes, and 10 seconds ago: <dmpayton> gnight | 01:04 |
*** nash has quit IRC | 03:31 | |
*** llnz has joined #tp | 04:32 | |
llnz | hi all | 04:50 |
*** mithro has quit IRC | 05:08 | |
*** mithro has joined #tp | 05:25 | |
llnz | hi mithro | 05:29 |
mithro | hey llnz | 05:29 |
llnz | bdnc2hp4 | 05:42 |
llnz | fun random strings | 05:42 |
mithro | so it's no longer your root password? | 06:29 |
llnz | it's not a root password | 06:31 |
llnz | fortunately | 06:32 |
mithro | so when will be able to play a game on tpserver-cpp? (IE Have working persistence) | 06:40 |
llnz | you can play now without persistence | 06:41 |
llnz | it might be a bit before persistence is fixed | 06:41 |
llnz | should finish chaning PlayerView (etc) before it is fixed | 06:41 |
mithro | llnz: well, without persistence all our hard work is lost if the server crashes or gets reset | 06:43 |
llnz | i know | 06:43 |
* llnz sighs | 06:59 | |
* llnz wanders off | 07:03 | |
llnz | later all | 07:03 |
*** llnz has quit IRC | 07:03 | |
jotham | so what was the deal with using Epyon's ships? | 08:43 |
mithro | jotham: they are GPLed | 09:26 |
*** tuna-fish has joined #tp | 09:35 | |
DystopicFro | mithro: pong? | 10:02 |
mithro | DystopicFro: ping! | 10:02 |
DystopicFro | ahoy | 10:02 |
mithro | seen all your cool progress! | 10:02 |
DystopicFro | >.< | 10:02 |
mithro | I wanted to chat to you about a couple of things | 10:03 |
DystopicFro | kk | 10:03 |
mithro | 1. Doing the generation for tpserver-py | 10:03 |
mithro | 2. Making the panel stuff work nicer | 10:03 |
mithro | DystopicFro: got some time to chat about it? | 10:04 |
DystopicFro | aye, just sitting down to cereal and coffee, so I've got plenty of time | 10:04 |
mithro | which do you want to do first? | 10:05 |
DystopicFro | well, for the panels, I'm working on that right now, but I'd like to hear your thoughts on that | 10:06 |
mithro | okay, I don't understand why are you creating/destroying the panels rather then just populating them with data? | 10:07 |
DystopicFro | yes, that was lazy of me, it was the first thing that I got working when I was starting out with wx | 10:08 |
mithro | ahh okay | 10:08 |
DystopicFro | and since it never had a performance impact for me I just put it on the back burner | 10:08 |
mithro | actually, the best way I think you could solve this problem is with a magic property | 10:09 |
DystopicFro | ahhh, intead of an explicit getter function, yeah? | 10:09 |
mithro | so you can just go "property_panel.object = abc; self.show(property_panel)" | 10:09 |
mithro | were object is | 10:09 |
mithro | def object(self, value): self.name.SetValue(value.name) | 10:09 |
mithro | or similar | 10:10 |
mithro | in fact I would probably go as far as to do the following | 10:11 |
mithro | create a "ParentPanel" which has a magic property which did something like | 10:11 |
mithro | def object(self, value): if isinstance(value, Component): self.component_panel = value; self.show(self.component_panel) | 10:12 |
DystopicFro | hm... | 10:13 |
mithro | the idea is that you manager which lets you select objects doesn't care about the object's type | 10:13 |
mithro | or how you are going to go about displaying them | 10:13 |
DystopicFro | Right...think I get the idea, I haven't done a whole lot with properties, but I'm pretty sure that I see where you're going with that | 10:14 |
mithro | properties are like setters/getters in Java | 10:15 |
mithro | except you don't have to worry about being explicit | 10:15 |
DystopicFro | yea, I just need to get a feel for them by using them I guess, I'm still not fully immersed in the looser pythonic way of doing things | 10:17 |
mithro | properties are very nice, because it allows you to change your class transparently | 10:17 |
mithro | IE The person using the class doesn't need to care that you are using properties | 10:18 |
mithro | say you do something like | 10:18 |
DystopicFro | are there any examples of that kind of use of properties in your code that I could look at? | 10:18 |
mithro | DystopicFro: I do some late loading in tpserver-py which might be helpful | 10:18 |
mithro | def ruleset_get(self): | 10:19 |
mithro | """\ | 10:19 |
mithro | Return the Ruleset (object) this game uses. | 10:19 |
mithro | """ | 10:19 |
mithro | try: | 10:19 |
mithro | return self.__ruleset | 10:19 |
mithro | except AttributeError: | 10:19 |
mithro | exec("from tp.server.rules.%s import Ruleset" % self.rulesetname) | 10:19 |
mithro | self.__ruleset = Ruleset(self) | 10:19 |
mithro | return self.__ruleset | 10:19 |
tpb | disconnected from worldforge: Ping sent at 2007-07-02T10:17:44 not replied to. | 10:20 |
mithro | then of course I have the | 10:20 |
mithro | ruleset = property(ruleset_get) | 10:20 |
mithro | which means the person can just do a | 10:20 |
mithro | g = Game(9) | 10:20 |
mithro | print g.ruleset | 10:20 |
mithro | and the ruleset is automatically loaded | 10:20 |
mithro | but if they never access g.ruleset, the data is never loaded | 10:21 |
mithro | that is a fairly common python pattern | 10:21 |
DystopicFro | ok, cool, I've got an idea of how to work that in now | 10:22 |
mithro | you should never really have something like "abc.set_peanut(True)" | 10:22 |
mithro | I think you have been fairly good in that regard | 10:23 |
mithro | overall, your code seem very good | 10:23 |
DystopicFro | It's hard for me to let go of the habits that I've acquired with C++ and Java with everything needing to be explicit | 10:23 |
DystopicFro | thanks o.O | 10:23 |
mithro | O btw, do you know about the dictionary method of string interpolation? | 10:24 |
DystopicFro | no | 10:25 |
mithro | for example the following code | 10:25 |
mithro | cpp_header = \ | 10:25 |
mithro | """\ | 10:25 |
mithro | #include <tpserver/game.h> | 10:25 |
mithro | #include <tpserver/designstore.h> | 10:25 |
mithro | #include <tpserver/category.h> | 10:25 |
mithro | #include <%s.h> | 10:25 |
mithro | %s::%s(){ | 10:25 |
mithro | } | 10:25 |
mithro | """ % (FILENAME , CLASS_NAME, CLASS_NAME) | 10:25 |
mithro | can be changed to the following | 10:25 |
mithro | cpp_header = """\ | 10:25 |
mithro | #include <tpserver/game.h> | 10:25 |
mithro | #include <tpserver/designstore.h> | 10:25 |
mithro | #include <tpserver/category.h> | 10:25 |
mithro | #include <%(FILENAME)s.h> | 10:25 |
mithro | %(CLASS_NAME)s::%(CLASS_NAME)s() { | 10:26 |
mithro | } | 10:26 |
DystopicFro | oh I like that. | 10:26 |
mithro | """ % vars() | 10:26 |
mithro | vars() gives you the local namespace as a dictionary | 10:26 |
DystopicFro | and that works for any dictionary in place of vars? in case I wanted to use some global variables in another class? | 10:26 |
mithro | you could have also done | 10:26 |
mithro | """ % {'CLASSNAME': 'hello', 'FILENAME': 'peanut'} | 10:27 |
mithro | opps I missed a _ in there - but I think you get the idea | 10:27 |
DystopicFro | yes, that's a very, very cool trick | 10:28 |
mithro | btw, here is another cool trick | 10:28 |
mithro | for i, value in enumerate(my_list): | 10:28 |
mithro | print i, value | 10:28 |
DystopicFro | ah, python is very nice with all of the conveniences it provides | 10:29 |
mithro | wxPython isn't a particularly pythonic | 10:30 |
mithro | it's slowly getting more pythonic however | 10:30 |
mithro | regex = re.compile('\s*\r?\n\s*') | 10:30 |
mithro | CFILE.write("void %s::%s {\n" % (CLASS_NAME, func_name)) | 10:30 |
mithro | CFILE.write(" Category* cat = new Category();\n") | 10:30 |
mithro | CFILE.write(" DesignStore *ds = Game::getGame()->getDesignStore();\n") | 10:30 |
mithro | CFILE.write("\n") | 10:30 |
mithro | CFILE.write(' cat->setName("%s");\n' % cat.name) | 10:30 |
mithro | CFILE.write(' cat->setDescription("%s");\n' % cat.description) | 10:30 |
mithro | CFILE.write(' ds->addCategory(cat);\n') | 10:30 |
mithro | CFILE.write(' return;\n') | 10:30 |
mithro | CFILE.write('}\n\n') | 10:30 |
mithro | I think you can see how to make that much nicer now :P | 10:31 |
mithro | anytime you have .write multiple times is very unpythonic | 10:34 |
mithro | don't need to flush files really ofile.flush() :P | 10:34 |
DystopicFro | >.< | 10:35 |
mithro | DystopicFro: I'm really excited about your stuff :P | 10:35 |
mithro | whats >.< ? | 10:35 |
daxxar | It's a smiley! | 10:35 |
DystopicFro | mithro: thanks, I've been working hard to get something really usable | 10:35 |
DystopicFro | >.< is ...hm...scrunchie eyes | 10:36 |
daxxar | Like someone from South Park squeezing their eyes together | 10:36 |
daxxar | Over a nose | 10:36 |
DystopicFro | sort of like that | 10:36 |
daxxar | (no mouth) | 10:36 |
mithro | so it isn't sideways? | 10:36 |
DystopicFro | (>.<) | 10:36 |
DystopicFro | -- | 10:36 |
DystopicFro | where the straight line is the off-kilter mouth | 10:37 |
* mithro is old skool smilly :) | 10:37 | |
daxxar | http://i9.photobucket.com/albums/a92/rjgore3/S.jpg | 10:37 |
tpb | <http://ln-s.net/fnd> (at i9.photobucket.com) | 10:37 |
DystopicFro | mithro: so, how do you want to handle code generation for tpserver-py? | 10:38 |
mithro | DystopicFro: well, it's probably easier and harder then tpserver-cpp | 10:38 |
mithro | I would like to be able to do two things | 10:38 |
mithro | - Synconise with a running Game | 10:38 |
mithro | - Dump the ruleset to disk so somebody without the RDE can load a new game | 10:39 |
* DystopicFro tilts his head | 10:39 | |
DystopicFro | I guess I'm misunderstanding where you're going with that because that sounds like a module for the server? | 10:40 |
mithro | DystopicFro: I think it might be a good idea to try and seperate out the following, GUI<->Internal Data format<->Code Gen | 10:40 |
mithro | DystopicFro: well, I would like you to be able to "upload" to a running server | 10:41 |
mithro | which is not as hard as it might sound | 10:41 |
mithro | I'm wondering if the best way is to make tpserver-py just understand the RDE.py file format | 10:42 |
mithro | then for "generation" you just save everything and call a command with the correct location? | 10:43 |
mithro | Have I totally lost you? | 10:43 |
DystopicFro | Well, I'm trying to imagine how this would be used, as I don't understand why we would want to add new properties and components to a running game? or are we talking about other things as well? | 10:43 |
mithro | the idea is that you may have long running games - kind of like a MMORPG | 10:45 |
mithro | so you would need to add new content as the game continues | 10:45 |
mithro | that is one side | 10:45 |
mithro | the other would be to speed up development | 10:45 |
mithro | you could see how the changes effect the game right away | 10:46 |
DystopicFro | ok, I can see that, yeah | 10:46 |
mithro | tpserver-py is really a thin wrapper around a SQL database | 10:46 |
* DystopicFro hasn't really poked around tpserver-py as of yet | 10:47 | |
mithro | as the RDE and tpserver-py are both python - we can also share code | 10:47 |
mithro | so we can do two things | 10:49 |
mithro | 1. You dump to some format (say CSV) and I write a CSV importer | 10:49 |
mithro | 2. I just read your project files directly | 10:49 |
DystopicFro | of which #2 seems more sound to me, though it would probably require some changes to the configuration files for projects, and also the XML storage for objects, maybe for a last modified date or the like | 10:51 |
mithro | I was originally thinking of doing 1. - but really I think #2 would make more sense | 10:52 |
mithro | but for this to work, we need to decouple the GUI and the code which reads in the XML | 10:52 |
mithro | it looks like you have gone some of the way | 10:52 |
DystopicFro | yea, that's fine, I've been wanting to change that for a long time, it feels really imcomplete and patchwork to me right now | 10:52 |
mithro | what I think you should try and do is the following | 10:53 |
mithro | have 3 directories | 10:53 |
mithro | gui <- only these classes import wx | 10:53 |
mithro | objects <- these classes read in the XML and present a set of objects which can be looked at | 10:54 |
mithro | codegen <- these classes take a set of objects and produce code | 10:54 |
mithro | gui <- only these classes import wx, these classes take a set of objects and display them using wx | 10:55 |
mithro | something like that? | 10:55 |
DystopicFro | I can work on refactoring it into something more like that, yes | 10:55 |
mithro | looking over the code, it looks like you have done that quite a bit already | 10:56 |
DystopicFro | I've tried very hard so far to make it extremely easy to add new object types...and I was satisfied to find that adding the Category "object" was very easy on Friday | 10:56 |
mithro | IE you have ComponentPanel.py and a Component.py | 10:56 |
DystopicFro | so it may not come out exactly like that, and I'll probably have to ask for some advice on how to separate some things because I've got things pretty set in my head right now | 10:57 |
mithro | have you ever use MVC design? | 10:57 |
DystopicFro | I've never implemented the pattern myself, but it's what I'm most familiar with through using Java's Swing | 10:57 |
mithro | The idea is that you decouple your data from the way you display it, pretty much? | 10:59 |
DystopicFro | right | 10:59 |
mithro | so you can rip out the GUI and replace it with something else at a later date | 10:59 |
DystopicFro | I aimed for that level of decoupling between the management of game objects in the ObjectDatabase and their representation in the GameObjectTree >.< | 11:00 |
mithro | yeah - it looks like you have almost gotten there | 11:00 |
mithro | to me it seem that "Code Generation" should be just another "View" | 11:01 |
mithro | If you moved GenerateCode and generateEditPanel out of category.py it seems like you would have succeeded? | 11:01 |
* DystopicFro has to take a bit of time to wrap his head around that abstractio | 11:02 | |
mithro | to me it seems like this | 11:03 |
mithro | a "View" is just a way of displaying the data - a GUI is a way of displaying your internal data in a way that a Human can understand | 11:03 |
mithro | a "View" is just a way of displaying the data - Code generation is a way of displaying your internal data in a way that the C++ server can understand | 11:03 |
DystopicFro | aye, and the fact that one is visual and dynamic and the other is static data is irrelevant | 11:04 |
mithro | yeah - the GUI just has the added feature that it can change your internal data too | 11:05 |
mithro | some people go as far as to decouple how you store the data on the disk and how you store it in memory - but I think that ends up being a bit silly most of the time | 11:06 |
* DystopicFro nods | 11:06 | |
DystopicFro | well, I guess I've got a bit of work to do this week, then o.O | 11:07 |
mithro | DystopicFro: looking at your code - I don't think it's going to turn out to be a huge amount of work | 11:09 |
DystopicFro | it will take me a bit of time to really grok what I'm actually doing, I think | 11:10 |
DystopicFro | that's why it took me so long to get started initially, I was having a hard time getting a good grip on managing the data and then displaying it as well | 11:10 |
mithro | I don't think it's a huge change to what you have | 11:11 |
DystopicFro | nar, but it's a huge change in how I've been thinking :P | 11:11 |
mithro | infact - I think it's probably just a "mv ./game_objects/*Panel.py ./gui/" | 11:11 |
mithro | and moving the CodeGenerate functions into a ./codegen/ directory | 11:12 |
* DystopicFro nods | 11:12 | |
DystopicFro | and messing with how panels are loaded and all that stuff | 11:12 |
mithro | I think a good rule of thumb would be follows | 11:13 |
mithro | - Game Objects, directory should not depended on anything else | 11:15 |
mithro | - GUI should depend on Game Objects | 11:16 |
mithro | - CodeGen should depend on Game Objects | 11:16 |
mithro | Both Game Objects and CodeGen should not have any wx code in them | 11:16 |
DystopicFro | aye, and for the most part that's how it already is | 11:18 |
DystopicFro | I guess I'll work on refactoring first, and then on performance enhancements | 11:18 |
mithro | hence you could possibly generate the code without ever running wx | 11:18 |
DystopicFro | mithro: and just a note about only allowing one category - that's how tpserver-cpp does it too >.< | 11:19 |
mithro | DystopicFro: opps! :P | 11:20 |
mithro | tpserver-py (and the clients) supports many categories | 11:22 |
DystopicFro | I'm going to try to talk to llnz tonight (which is tomorrow morning, I guess, for you all) and find out how hard it would be to add support for multiple categories in tpserver-cpp | 11:23 |
DystopicFro | it shouldn't be too hard, I don't think, and I can probably add that in fairly quickly | 11:23 |
mithro | DystopicFro: cool | 11:23 |
mithro | keep up the good work | 11:24 |
DystopicFro | I'm just glad it's thought of as good work :P and I'll certainly keep at it | 11:24 |
DystopicFro | the fun stuff will be getting that TPCL expression editor up and running | 11:25 |
mithro | yeah, that will be pretty cool | 11:27 |
DystopicFro | kk, I'm off, talk to ya laters mithro | 11:28 |
mithro | DystopicFro: okay | 11:28 |
mithro | DystopicFro: feel free to email me with questions | 11:33 |
mithro | hrm... no niphree :/ | 12:39 |
*** tuna-fish has quit IRC | 13:01 | |
*** tuna-fish has joined #tp | 13:45 | |
mithro | Epyon: ping? | 14:01 |
Epyon | mithro, pong :) | 14:25 |
mithro | any chance you could give niphree a call and tell her that she is suppose to be having a meeting with me 30 minutes ago? | 14:27 |
Epyon | mithro, just phoned her. She's still at the uni talking about here masters thesis, she wanted to be on time, but y'know it's impolite to break down a conversation with someone who helps you with your thesis :/. She said she'll be here ASAP. | 14:31 |
mithro | okay | 14:31 |
mithro | Epyon: I'm afraid I have to go get a couple of hours sleep | 14:57 |
mithro | can you tell her to send me the task list via email and it would be really good if she could be around early tomorrow | 14:57 |
mithro | Epyon: also sent her an email | 15:01 |
mithro | gnight | 15:01 |
*** mithro has quit IRC | 15:19 | |
*** MihaiBalan has joined #tp | 16:25 | |
*** Epyon_ has joined #tp | 16:34 | |
*** nash has joined #tp | 18:58 | |
*** mithro has joined #tp | 19:07 | |
* nash wavse | 19:17 | |
mithro | hey nash | 19:18 |
nash | DystopicFro: *poke* | 19:18 |
mithro | nash: had a chat to him last night | 19:19 |
mithro | should be in the logs | 19:20 |
nash | mithro: Okay | 19:20 |
nash | Where are the logs? | 19:20 |
*** mithro has joined #tp | 20:01 | |
mithro | nash: http://www.thousandparsec.net/~irc/ | 20:05 |
tpb | Title: Index of /~irc (at www.thousandparsec.net) | 20:05 |
mithro | it use to be in the topic :/ | 20:05 |
tpb | tpb has joined on worldforge | 20:09 |
tpb | mode change by purple.worldforge.org on worldforge: +nt | 20:09 |
tpb | disconnected from worldforge: Ping sent at 2007-07-02T20:12:29 not replied to. | 20:14 |
tpb | tpb` has joined on worldforge | 20:18 |
tpb | mode change by purple.worldforge.org on worldforge: +nt | 20:18 |
tpb | nick change by tpb` to tpb on worldforge | 20:18 |
tpb | mode change by purple.worldforge.org on worldforge: -o tpb | 20:20 |
tpb | mode change by purple.worldforge.org on worldforge: -t | 20:20 |
tpb | aloril has joined on worldforge | 20:20 |
tpb | disconnected from worldforge: Ping sent at 2007-07-02T20:31:25 not replied to. | 20:34 |
tpb | tpb has joined on worldforge | 20:50 |
tpb | disconnected from worldforge: Ping sent at 2007-07-02T21:12:04 not replied to. | 21:14 |
tpb | tpb` has joined on worldforge | 21:14 |
tpb | tpb has quit worldforge (Read error: Connection reset by peer) | 21:14 |
tpb | nick change by tpb` to tpb on worldforge | 21:14 |
DystopicFro | nash: ping? | 21:53 |
nash | pong | 21:57 |
DystopicFro | ahoy nash, sorry I'm late tonight, went out for dinner with the gf and took longer than expected getting back | 21:57 |
nash | I guessed something like that ;-) | 21:58 |
nash | So how goes it? | 21:58 |
DystopicFro | going well, had a good talk with mithro earlier and got set up with things to do this week | 21:58 |
DystopicFro | first and foremost is refactoring for separation of gui, data structures and data representations | 21:59 |
DystopicFro | then the performance issues with the panel swapping | 21:59 |
DystopicFro | and then work on code generation for tpserver-py | 21:59 |
DystopicFro | since mithro wants some custom stuff there, uploading objects to a server that's already running and stuff, I'll have to be working with him on that | 22:00 |
* nash worries code gen for the python and cpp servers may be a major PITA to maintain | 22:00 | |
nash | What other major features did you want implemented? | 22:00 |
DystopicFro | in the near future? none...I want to clean things up before the midterm, I figure it's a good point to refactor and refine | 22:01 |
DystopicFro | then I can get into the TPCL expression editor and convenience aspects for the UI | 22:01 |
nash | Right. So you are generally feature happy with the current code gen - just want to clean stuff up? | 22:02 |
nash | I haven't played with it yet - how does your server with your code run? | 22:03 |
DystopicFro | Yes, I feel like I achieved everything I wanted to get done by now, and I'll probably add a few more things in | 22:03 |
DystopicFro | Flawlessly so far as I can tell, although the FroShip is...slightly unbalanced | 22:03 |
nash | Cool ;-) Good to know... You need to try and rope some people in to try it... Epyon is probably a good person to test with ;-) | 22:03 |
nash | heh | 22:04 |
nash | Only available to players named 'fro' ? | 22:04 |
DystopicFro | and, yar, meh tpserver-cpp is still up running on the generated code | 22:04 |
DystopicFro | lol, aye, special easter egg just for me | 22:04 |
DystopicFro | yea, after I polish it I think I'll post to tp-devel with an announcement | 22:04 |
nash | Have you pushed those changes then? I'd like to see them in mainline ASAP. Get them really tested | 22:05 |
* nash notes more then most TP code... ;-) | 22:05 | |
DystopicFro | I have yet to get the chance to talk to llnz :( and I can't push to the tpserver-cpp repo on the tp server | 22:06 |
nash | Well I spoke briefly - he has no problem with you pushing to a branch. Why can't you push? | 22:06 |
DystopicFro | it's just a permissions error | 22:07 |
nash | Blerg :-( | 22:08 |
nash | I'll hassle either mithro or llnz over it then | 22:08 |
nash | You should be able to push :-( | 22:08 |
nash | Then we can deprecate the old tpserver-cpp/minisec code. Then see how far you can get into mtsec ;-) | 22:08 |
DystopicFro | >.< I think I'll get my TPCL expression editor up and running first, and then use that to push mtsec forward :P | 22:10 |
nash | That's cool... | 22:14 |
tpb | disconnected from worldforge: Ping sent at 2007-07-02T22:42:14 not replied to. | 22:44 |
tpb | tpb_ has joined on worldforge | 22:45 |
tpb | tpb has quit worldforge (Read error: Connection reset by peer) | 22:45 |
tpb | nick change by tpb_ to tpb on worldforge | 22:45 |
tpb | disconnected from worldforge: Ping sent at 2007-07-02T23:42:58 not replied to. | 23:45 |
Generated by irclog2html.py 2.5 by Marius Gedminas - find it at mg.pov.lt!