Input System
Aug 28, 2008
[ENGLISH]
I've done the base of the graphic system, so I'll try to finish other systems before I do everything that's left on the graphic system. Yesterday I started with the input system, which I've cleaned up a lot, and now is more usable. And now gamepads work ok.
Everything went smoothly, and I didn't encounter any suspicious bug. It has been too simple though, I had more trouble with the other systems. But at least, this gives me some motivation, which at this state is pretty welcome.
[ESPAÑOL]
Ya he sentado las bases del módulo de gráficos. Estoy tratando de terminar los otros subsistemas antes de terminar la parte gráfica por completo. Ayer empecé con el módulo de entrada, que ha quedado mucho más claro, y más sencillo de usar. Oh, y ahora los gamepads funcionan bien.
Todo ha salido a pedir de boca, y no me encontré ningún bug. De hecho, ha sido demasiado fácil, ya que tuve más problemas con otros módulos. Al menos, me sirve para subirme un poco la moral, que a estas alturas del proyecto es algo que se agradece.
Posted byMiguel Herrero at 2:42 PM 0 comments
Labels: input
Feature Freeze
Aug 26, 2008
[ENGLISH]
The day has come: I'm out of time. So, although I know some things will be left out, I'm going to stop right now. I'll finish what I've already started, even the sound system.
I'll have plenty of time to improve everything later. I have to finish all the incomplete systems now, or I won't release anything, never.
[ESPAÑOL]
El día ha llegado: se me acaba el tiempo. Así que, a pesar de que me dejo algunas cosas importantes en el tintero, voy a parar tal y como lo tengo ahora. Es decir, terminaré de integrar todo lo que tenía hecho y finalizaré el módulo de sonido.
Luego ya habrá tiempo de mejorarlo. En algún momento hay que parar y terminar lo que se ha dejado a medias, o corre el riesgo de no terminarlo nunca.
Posted byMiguel Herrero at 11:51 PM 0 comments
Rush hour
Aug 23, 2008
[ENGLISH]
I've finished the file system, making more changes that I had planned. But I've used that to test the resource management, because now files are treated as a resource.
I started coding the scene module yesterday night. I did the base classes, which were more or less what I already had, a bit simpler though. I should start with the complex part today: specifying the bounding volumes for each node, to prepare everything for frustum culling.
By now, though I haven't got much time left, everything is much cleaner. But the most complex systems still await, so it's not time to celebrate anything. Just wait a little bit more.
[ESPAÑOL]
He terminado el subsistema de ficheros, haciendo más cambios de los que había planeado en un principio. De paso, he aprovechado para probar la gestión de recursos, ya que ahora los ficheros son tratados como un recurso.
Ayer por la noche empecé con el módulo de escena, haciendo las clases básicas. Más o menos ha quedado intacto, aunque se han simplificado algunas cosas. Hoy debería empezar con la parte más compleja, en la que especifico los volúmenes de cada nodo para poder hacer culling posteriormente.
De momento, aunque voy algo mal de tiempo, el resultado está siendo bueno. Pero todavía quedan los subsistemas más complejos, así que habrá que esperar un poco antes de cantar victoria.
Posted byMiguel Herrero at 11:14 AM 0 comments
All your base are belongs to us
Aug 20, 2008
[ENGLISH]
These days I've been re-writing Flexo's base classes. Everything went ok, although I had to change some things that were (strangely) impossible to do in Java: like abstract static methods. But I did some workarounds and the code still looks clean.
Today, I finished the math classes, which I've surrounded with an interface to force users to use 'set' methods instead of changing the values directly on those classes. I've also coded a sinple pooling system to keep the garbage collector quiet enough.
The next step is the scene manager (one of the reasons of the re-design of the engine) and after it, the other modules. I'll try to re-use much of the code of them, so I hope I won't spend much time from now on.
[ESPAÑOL]
Estos últimos días he estado re-escribiendo las clases base de Flexo. Todo ha salido bien, aunque he tenido que cambiar algunas cosas que no pensaba que serían imposibles de hacer en Java: como métodos estáticos abstractos. De momento todo va bien y está quedando un código relativamente limpio.
Hoy por la tarde terminé las clases matemáticas, que he encubierto con un interfaz para no permitir a los usuarios modificar los valores directamente y obligarles a usar los métodos 'set' pertinentes. También he programado un sencillo sistema de pooling para no tener al recolector de basura demasiado ocupado.
El siguiente paso es el gestor de escenas (uno de los motivos de este re-diseño del motor) y, a partir de ahí el resto de módulos. De ahí podré aprovechar mucho código así que espero que no me lleve demasiado tiempo.
Posted byMiguel Herrero at 11:44 PM 0 comments
No more UML
Aug 16, 2008
[ENGLISH]
I've been modelling UML diagrams all week and I'm beaten, I need to start to code something or I'll go mad. I'm starting to mix the things I've done already and the new modifications of the design. I need to take a step back to see things more clear.
The changes that I wanted to do are already done, so the only thing left is refactoring some classes, and clean them up a bit. Instead of use the code generation from the diagram, I'm going to code it little by little, to detects mistakes I could have done.
[ESPAÑOL]
Llevo toda la semana con el UML y estoy hasta el gorro, voy a empezar a programar algo porque me estoy volviendo loco con tanto diagrama. Además, se me empiezan a juntar las cosas que ya tengo hechas con las que quiero modificar y empiezo a no ver las cosas con suficiente claridad.
Realmente, los cambios que tenía en mente ya están hechos, y lo que queda es básicamente aprovechar lo que ya tenía hecho, limpiándolo un poco. En vez de generar el código a partir del diagrama, creo que voy a ir poco a poco escribiéndolo para detectar posibles fallos.
Posted byMiguel Herrero at 6:52 PM 0 comments
Labels: uml
Designing the engine
Aug 12, 2008
[English]
I havent updated in a while, partly because I've switched my computer for a new one. But that took me very little, I've spent most of the time designing the engine. I started using a simple diagramming program called VioletUML, too simple for my needs. I tried AgroUML, but I didn't like que screen usage, and I didn't feel comfortable using it.
Finally, I installed StarUML and that what I'm using now. It works great, though the last update was long time ago, even the code generation works well enough. I'm designing the small subsystems right now, and I've already fixed some errors the previous design had. I like the results, though we'll have to see how it behaves as soon I start programming on it.
I would like to design everything this week and spend the rest of August on the programming.
[Español]
No he actualizado esto en un tiempo, en parte porque he cambiado de ordenador. Sin embargo eso solo me ha llevado un par de días, el resto lo he dedicado a diseñar el motor. Empecé usando VioletUML, un programa sencillo de diagramas, tan sencillo que enseguida se me ha quedado corto. Probé AgroUML, pero me parecía que desperdiciaba demasiada pantalla y no me sentía cómodo trabajando con él.
Al final, instalé StarUML y es con el que estoy trabajando ahora. Aunque la última actualización es de hace mucho tiempo, funciona bien y la generación de código es suficiente para mí.
De momento estoy diseñando los subsistemas pequeños, aunque ya he corregido algunos errores que arrastraba el diseño anterior. Estoy contento con el resultado, aunque habrá que ver si cuando empiezo a programar necesito modificarlo o no.
Me gustaría dedicar esta semana por completo al diseño y dejar lo que queda de Agosto para programar.
Posted byMiguel Herrero at 11:26 PM 0 comments
Labels: agrouml, design, staruml, violetuml
Singleton Frenzy
Aug 7, 2008
[ENGLISH]
I've started to build the final class diagrams. Most thigs will stay as they are now, but other are too complex, and must be simplyfied. My goal with this library is to make things easier for the developer.
For example, until now, you could access the engine through the Engine class. To get the graphic engine you should type this:
(GraphicSystem)Engine.getSystem(GraphicSystem.ID)
It doesn't look easy to remember. So the best solution I can think of is to make every subsystem a Singleton because, well, there should be only one instance per subsystem. But it would be nice to be able to access them this way:
GraphicSystem.createMesh(...)instead of...
GraphicSystem.getInstance().createMesh(...)Because the calls would be too long. But I would hace to make a static method for each non-static method. I could also replace the getInstance method for something shorter, like just get, or call. Any suggestions?
[ESPAÑOL]
Ya he comenzado a tirar diagramas de clases en serio. Muchas cosas se van a quedar como las diseñé en un primer momento, pero otras creo que han resultado demasiado complejas, y hay que simplificarlas. No en vano mi idea es que esta librería sea sencilla de utilizar.
Por ejemplo, hasta ahora, el acceso al motor era a través de la clase Engine. Para acceder al motor gráfico, había que hacer:
(GraphicSystem)Engine.getSystem(GraphicSystem.ID)
Y no parece algo demasiado intuitivo que digamos. Así que creo que la mejor solución va a ser que cada subsistema sea un Singleton ya que, en realidad, solo va a existir una instancia de cada subsistema.
Pero lo cómodo sería poder hacer:
GraphicSystem.createMesh(...)
en lugar de
GraphicSystem.getInstance().createMesh(...)Porque las llamadas serían demasiado largas. Pero tendría que hacer una llamada estática para cada llamada no estática. También podría sustituir el getInstance por algo más corto, quizás el get a secas, o call. ¿Alguna sugerencia?
Posted byMiguel Herrero at 3:38 PM 0 comments
Labels: singleton
Simple Frustum Culling
Aug 4, 2008
[ENGLISH]
These days, while fighting a toothache, I've been thinking in the way of manage world objects. A short term objective will be add simple Frustum Culling. So I'll check if an object is seen, one by one. If I've got enough spare time I will like to add an octree, and I've been thinking how to do it.
Basically, I would have a standard list to store dynamic objects and the octree to store the static ones. But I don't like having TWO types of objects. If an object moves, it will go to the list, and if an object of the list doesn't move for a while, it will be sent to the octree.
I guess that, most of the time, objects tend to be static or dynamic. And dynamic objects will move again in very little time. It's like applying the principle of temporal locality to this problem. In theory, it sounds good, so it's time to start thinking on the implementation.
[ESPAÑOL]
Estos días, alternando con un dolor de muelas, he estado pensando en la manera de gestionar los objetos en el mundo. Lo que me voy a plantear a corto plazo va a ser hacer simplemente Frustum Culling. Es decir, comprobar objeto a objeto si se ven o no. Si me da tiempo, me gustaría incluir un octree, y ya me he decidido cómo organizarlo.
Básicamente, tendría una lista normal y corriente para los objetos dinámicos y el octree para los objetos estáticos. Sin embargo, no me gusta tener en la jerarquía esta distinción, por lo que solo habría un tipo de objeto. Si un objeto se mueve, pasaría a la lista de objetos dinámicos. Y si un objeto de esa lista lleva cierto tiempo sin moverse, volvería al octree.
Supongo que, en la mayoría de los casos, los objetos tiendan a ser estáticos o dinámicos. Y posiblemente los objetos que se muevan, se moverán otra vez dentro de poco. Básicamente es el principio de localidad aplicado a este problema. La teoría no pinta mal, así que ahora toca empezar a pensar en la implementación.
Posted byMiguel Herrero at 2:47 PM 0 comments
Object Culling
Aug 1, 2008
[ENGLISH]
As I've mentioned before, most of the features are already implemented. But there are some things that need to be done yet. One of those was about culling scene objects.Specially graphic and physic objects, to avoid complex calculations. In the graphic module, that would mean to avoid updating objects that are not seen on the screen.
But, I've got no experience at all on that stuff (and not much time left either) so I prefer to avoid complex programming. The easiest thing would be to let the user make "rooms" of objects manually, so that objects outside would be culled. But that wouldn't work in long term.
The best thing would be to use an octree, but there are many things I don't know about those, like what to do if an object moves outside the scene, would I have to update the entire tree?. Another solution could be to have static and dynamic objects, but this just would move problems to another place (mostly the physics module).
I'll be thinking about the hole thing today and I hope I'll find what to do, more or less.
[ESPAÑOL]
Como ya he mencionado, la funcionalidad más importante está ya implementada. Sin embargo quedan pequeños aspectos por pulir. Uno de ellos era sobre cómo abordar el filtrado de elementos de la escena. Especialmente en la parte gráfica y la física, resulta importante poder descartar objetos que no son necesarios para evitar cálculos. En el módulo gráfico, esto implicaría descargar los objetos que no se ven.
Sin embargo, mi inexperiencia en el cambio (y la falta de tiempo también) hacen que no quiera complicarme mucho con este aspecto. La solución más sencilla sería no incluir nada de esto, pero después de tanto tiempo queriendo programar una solución, creo que ya va siendo hora de ponerme con ello.
Lo más sencillo sería hace agrupaciones manuales, haciendo que el usuario defina "habitaciones" y que lo que quede fuera de esa habitación sea descartado. Sin embargo es muy engorroso y tampoco es que me evite complicaciones.
Lo ideal sería utilizar un octree, pero hay muchos interrogantes que no se cómo manejar. Por ejemplo, si un objeto se sale de la escena, haciendo el octree más grande ¿qué tendría que recalcular?. Supongo que tendré que darle vueltas a esto o, quizá, definir objetos dinámicos y estáticos, y meter en el octree solo a los estáticos. Pero esto me crearía problemas en otros sitios, y no sería más que trasladar el problema a otro sitio.
Le estaré dando vueltas a este tema todo el día, a ver si me viene la inspiración.
Posted byMiguel Herrero at 5:30 PM 0 comments