TODO updates
[supertux.git] / TODO
1 SuperTux TODO
2 =============
3
4 This is a list of tasks and issues that might be worth to implement or
5 fix. This list is however not an authorative list of things that must
6 be done, its a collection of random things that pop up during
7 development, therefore not everything in here might be well thought
8 out or worth to implement. Use your brain before implementing anything
9 on this list and always think about how useful a new feature would be
10 in the context of the whole game or if a potential performance
11 enhanchment, actually enhanchmes anything at all.
12
13 Coding Standard Stuff
14 =====================
15
16 * make code clean: "-O2", "-g3",
17                      "-ansi",
18                      "-pedantic",
19                      "-Wall",
20                      "-Wextra",
21                      "-Wnon-virtual-dtor",
22                      "-Weffc++",
23                      "-Wconversion",
24                      "-Werror",
25                      "-Wshadow",
26                      "-Wcast-qual",
27                      "-Winit-self", # only works with >= -O1
28                      "-Wno-unused-parameter",
29
30 * remove overuse of multi-inheritance 
31
32 * remove overuse of friend'ship
33
34 * maybe mark interfaces as interfaces (ISerializable or SerializableInterface)
35
36 * split files with multiple classes into multiple files with one class each
37
38 * static vs anonymous namespace
39
40 * check the code with Valgrind
41
42 * use Vector in Physics for 'a' and 'v'
43
44 * replace random generator with mersene twister and/or move to external/
45
46 * write/finish scripts for include sorting and include guard checking that
47   can be run automatically
48
49 * md5.hpp and random_generator.hpp could go to external/
50
51 * write scripts to automatically check for:
52
53   - all includes are relative to top level dir
54
55   - include guards are proper
56
57 TODO
58 ====
59
60 * GameObject::RemoveListenerListEntry: Ughs, somebody trying to
61   implement a list class within in the GameObject?!
62
63 * add --datadir DIR (data/) and --userdir DIR (~/.supertux/)
64
65 * make gravity a constant
66
67 * funky side effect of too much global variables: when having a
68   savegame with large or firetux and then starting that game, Tux in
69   the menu background will grow and be visible that way for a fraction
70   of a second
71
72 * rename Vector -> Vector2f
73
74 * get rid of global SDL_Screen* screen variable
75
76 * identify all global variables and make them ugly (g_ or globals::)
77
78 * get rid of SCREEN_WIDTH/SCREEN_HEIGHT
79
80 * is version.h actually needed?
81
82 * resolution menu entry moves the wrong way around
83
84 * having dictionary_manager in Lisp is extremely ugly
85
86 * enforce proper naming of files to match their class
87
88 * get rid of NDEBUG and conditional compilation, these should be
89   reserved for a few tiny cases, not spread all over the code
90
91 * split particlesystem_interactive
92
93 * collect all manager classe into globals.hpp
94
95 * more moving directories around?
96
97 addon/  
98 audio/  
99 control/
100 gui/    
101 lisp/   
102 math/
103 physfs/ 
104 sprite/ 
105 util/
106 video/
107 squirrel/
108   for generic squirrel code
109 supertux/
110   worldmap/
111   trigger/
112   scripting/
113     for scripting wrapper code
114   badguy/
115   object/
116
117 * implement PNG screenshot
118
119 * having hitbox in Sprite is fugly
120
121 * write decal object
122
123 * implement surface and/or sprite scaling (MipMaps?)
124
125 * add code that compares the last Log line with the current, if they
126   are the same reject them and just output something like:
127
128   * last line has been repeated X times
129
130 * file naming is inconsistent: some times we use '_' to separate
131   words, sometimes we don't
132
133 * implement: http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
134
135 * workaround for Ubuntu pulseaudio/OpenAL brokeness:
136
137 $ cat ~/.alsoftrc
138 drivers = oss
139
140 * peaking up/down doesn't work properly
141
142 * peaking left/right should make Tux look into that direction (up/down to, needs new sprites)
143
144 * add pipe graphics that makes a 90 degree turn
145
146 * keep possible future SDL1.3 upgrade in mind
147
148 * cleanup scripting interface
149
150 * remove cloud tiles, replace with decal
151
152 * option menu has text overlap in "aspect ratio"
153
154 * jumping up from an enemy doesn't make a sound
155
156 * add support for automatic scrolling backgrounds
157
158 * add direct reading of Vector2f to Reader/lisp
159
160 * replace bell with 'reset block', that starts to glow once bumped
161   into (or something different)
162
163 * refactor Camera code, break ugly long functions into pieces and such
164
165 * allow fully custom magnification levels from command line (maybe GUI
166   to if there is a proper/easy way to let the user enter numbers)
167   (--magnification or -g WIDTHxHEIGHT:ASPECTX:ASPECTY@MAGNIFICATION)
168
169 * use AnchorPoint in Background instead of Alignment
170
171 * allow gradients to parallax scroll like Background (make it optional)
172
173 * add multicolored gradients (see Windstille source code, which can deal with Gimp gradients)
174
175 * fix alpha blending in the SDL renderer, currently all sprites (Tux,
176   etc.) appear transparent
177
178 * position of statistics text on the worldmap doesn't scale properly with resolution it seems
179
180 * gluBuild2DMipmaps leads to blurriness, maybe lack of magic offset
181   (0.375f, 0.375f, 0.0f) or something else
182
183 * font system has blending artifacts at non-1x magnifications, need to
184   have an transparent pixel between letters
185
186 * add a (border #t) flag to fonts, that allows to use fonts which have
187   a 1px transparent border around glyphs, which is needed to get rid
188   of blending artifacts in OpenGL
189
190 * mouse cursor has blend artifact on high magnification
191
192 * shadow font glyphs bleed into other glyphs
193
194 * in DrawingRequest "void* request_data;" is only free'ed, but the
195   destructor never gets called
196
197 * sprite/sprite.cpp: frame should never get out of range:
198
199   if((int)frame >= get_frames() || (int)frame < 0)
200     log_warning << "frame out of range: " << (int)frame << "/" << get_frames() << " at " << get_name() << "/" << get_action() << std::endl;
201
202 * Surface::hflip() is used exactly once, should probally be part of the constructor
203 \f
204 Scenegraph and Physics Engine Restructuring
205 ===========================================
206
207 * random idea to restructure engine stuff (might lead to nicer code
208   and easier scriptability and a need to rewrite lots of stuff...):
209
210 class SomeBadGuy : public PhysicsCallbackListener // or use boost::function
211 {
212 private:
213       PhysicsPtr box;
214       SpritePtr sprite;
215         
216 public:
217       SomeBadGuy(Engine& engine)  
218       {
219          box    = engine.physics().create_box(Rectf(0,0,32,32));
220          box->register_listener(this);
221          sprite = engine.graphics().create_and_add_sprite("Foobar");
222       }
223
224       void update(float delta)
225       {
226          // not much to do, as most stuff is done internally in the engine
227          if (dead)
228          {
229                   sprite->replace_with("Foobar_dead");
230          }
231          else
232          {
233                 sprite->hide();
234                 sprite->set_pos(box->get_pos());
235         }
236       }
237
238       // no more draw(), done by the scene graph
239
240       void on_collision(CollisionData data)
241       {
242         // respond
243       }
244 };
245 \f
246 Subversion->Git/Mercurial/Bzr Move
247 ==================================
248
249 * right now a switch doesn't seem to be worth it
250
251 * core issue right now isn't SVN, but old SVN version on lethargik.org
252   (lacks merge tracking and issues with viewvc)
253
254 * cleanup SVN to make import into other version control systems possible:
255
256  - Should we merge trunk/supertux-milestone1 and trunk/supertux when switching to Git/Hg/...?
257
258 Mistakes: incorrect branch creation: r5201-5207
259
260 tags/start           # unknown
261 tags/supertux        # unknown
262 tags/supertux_0_1_0
263 tags/supertux_0_1_1
264 tags/supertux_0_1_2
265 tags/supertux_0_1_3
266
267 branches/cobble      # unknown
268 branches/milestone1  # unknown
269 branches/new-collision-detection # unknown
270 branches/README      # documentation that will be lost in conversion
271 branches/supertux    # unknown
272 branches/supertux_0_1_1_branch
273 branches/supertux-box2d  # mathnerd (trash)
274 branches/supertux-editor-newdrawing # editor
275 branches/supertux-editor-newdrawing2 # editor
276 branches/supertux-milestone1-olpc    # supertux-milestone1
277 branches/supertux-milestone2-grumbel # supertux
278 branches/supertux-nogl               # supertux(?)
279 branches/supertux-sharp              # another supertux editor
280 branches/unison-video                # ???
281 branches/vendor                      # ??? CVS crap
282
283 trunk/cobble          # some editor?
284 trunk/CVSROOT         # ??? CVS crap
285 trunk/htdocs          # htdocs
286 trunk/jnrcol
287 trunk/media
288 trunk/SDL_tty
289 trunk/setup2x
290 trunk/supertux
291 trunk/supertux-editor
292 trunk/supertux-milestone1
293 trunk/supertux-portable
294 trunk/supertux-sharp
295 trunk/wiz-test
296
297
298 Potential Git Issues
299 ====================
300
301 * lack of sparse/narrow/shallow checkout, this means initial checkout
302   will be 200MB instead of 100MB
303
304 * no free hoster that allows >1GB repositories (haven't checked all,
305   but those I did came out way short) -> could use lethargik.org
306
307 * some free hosters that might allow >1GB repositories don't allow
308   having multiple repositories
309
310 * git submodule doesn't seem to be quite ready to replace our
311   trunk/supertux, trunk/supertux-editor, trunk/media/, ... layout as
312   it for example doesn't support automatic tracking of HEAD from the
313   remote repositories, it also feels rather hacky and not properly
314   integrated into git
315
316 * lack of metadata versioning, if you delete a branch in git that you
317   haven't merged, then its gone after the next gc/repack (+ two weeks
318   time limit it seems), in SVN on the other side you can checkout the
319   way the tree was at a specific date, its impossible to lose history
320   unless you hack the repository
321
322 svn2bzr.py
323 ==========
324
325 Committed revision 5727
326 Committed revision 5728
327 Committed revision 5729
328 Committed revision 5730
329 Traceback (most recent call last):
330   File "./svn2bzr.py", line 194, in <module>
331     main()
332   File "./svn2bzr.py", line 187, in main
333     log=log)
334   File "./svn2bzr.py", line 88, in svn2bzr
335     creator.run()
336   File "/mnt/bzr/svn2bzr/branchcreator.py", line 622, in run
337     entries = self.filter_entries(entries)
338   File "/mnt/bzr/svn2bzr/branchcreator.py", line 671, in filter_entries
339     entries = self.filter_moves(entries)
340   File "/mnt/bzr/svn2bzr/branchcreator.py", line 727, in filter_moves
341     entries = self.filter_simult_fren_dirmove(entries)
342   File "/mnt/bzr/svn2bzr/branchcreator.py", line 784, in filter_simult_fren_dirmove
343     newfname = svnrelpath(newdpth, newfpth)
344   File "/mnt/bzr/svn2bzr/branchcreator.py", line 60, in svnrelpath
345     raise errors.PathNotChild(path, base)
346 bzrlib.errors.PathNotChild: Path "trunk/media/images/creatures/mr_cherry/cherrybomb.xcf" is not a child of path "trunk/media/images/creatures/mr_bomb"
347 \f
348 Random Notes
349 ============
350
351 * calculate the size of an background image that should fill the screen:
352
353   image_size = (1 - parallax_speed) * screen_size + level_size * parallax_speed
354
355 def calc(parallax, screen, tiles):
356     return (1 - parallax) * screen + parallax * tiles * 32
357
358 \f
359 Supported Resolution
360 ====================
361
362 SuperTux shall support resolutions from 640x480 to 1280x800 at a magnification of 1x.
363 For resolutions higher, such as 2560x1600, upscaling will be used.
364 For resolutions smaller, like 320x240 downscaling will be used.
365
366 Higher resolution graphics for 2x maginification might be provided.
367 Lower res graphics for 0.5x maginification might be provided as well.
368
369 Resolution and magnification can be freely configured by the user within the given limits.
370
371 In tiles this means we have 40x25 (=1280x800px) tiles per screen.
372
373 # EOF #