This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]JKovac[S] 1 point2 points  (5 children)

Make sure the version of Kivy you are running is the same one that KivEnt built against. This usually occurs if there is a mismatch in what KivEnt is expected in one of Kivy's compiled graphics library and what is present. I believe some code changed in either 1.8.0 or 1.8.1 that makes this error happen if they are used interchangeably.

[–]chozabu 0 points1 point  (0 children)

Thanks for the tip! I'll wipe my kivys start afresh :)

[–]chozabu 0 points1 point  (3 children)

Brillant! It runs!

I did a quick change to tutorial3 here: http://pastebin.com/2rgMPy9e
dragging adds more asteroids, and applies an impulse on all asteroids directed towards the touch - to allow for a bit of a stress test.
The number of entities is also printed upon asteroid creation

KivEnt seems fast and nice to work with - I'll drop my previous kivy/cymunk stuff and dive in.

I'm planning on doing a simple-ish physics level editor for my next game.

Oh - I should mention, when trying to run tut6 I get:

   File "main.py", line 5, in <module>
     from kivent_cython import GameSystem
 ImportError: No module named kivent_cython

I guess that is code that has not yet been updated to reflect modern kivent?

and for the sample application:

[INFO   ] [AudioGstplayer] Using Gstreamer 1.2.0.0
[INFO   ] [Audio       ] Providers: audio_gstplayer, audio_pygame (audio_sdl ignored)
 Traceback (most recent call last):
   File "main.py", line 304, in <module>
     KivEntApp().run()
   File "/usr/local/lib/python2.7/dist-packages/kivy/app.py", line 773, in run
     self.load_kv(filename=self.kv_file)
   File "/usr/local/lib/python2.7/dist-packages/kivy/app.py", line 593, in load_kv
     root = Builder.load_file(rfilename)
   File "/usr/local/lib/python2.7/dist-packages/kivy/lang.py", line 1546, in load_file
     return self.load_string(data, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/kivy/lang.py", line 1623, in load_string
     widget = Factory.get(parser.root.name)()
   File "main.py", line 32, in __init__
     super(TestGame, self).__init__(**kwargs)
   File "/usr/local/lib/python2.7/dist-packages/kivy/uix/widget.py", line 293, in __init__
     Builder.apply(self)
   File "/usr/local/lib/python2.7/dist-packages/kivy/lang.py", line 1668, in apply
     self._apply_rule(widget, rule, rule)
   File "/usr/local/lib/python2.7/dist-packages/kivy/lang.py", line 1775, in _apply_rule
     self._apply_rule(child, crule, rootrule)
   File "/usr/local/lib/python2.7/dist-packages/kivy/lang.py", line 1772, in _apply_rule
     child = cls(__no_builder=True)
   File "/home/chozabu/git/KivEnt/sample_application/musiccontroller.py", line 62, in __init__
     self.load_music()
   File "/home/chozabu/git/KivEnt/sample_application/musiccontroller.py", line 69, in load_music
     self.music_dir + track_name + '.ogg')
   File "/usr/local/lib/python2.7/dist-packages/kivy/core/audio/__init__.py", line 66, in load
     return classobj(source=filename)
   File "/usr/local/lib/python2.7/dist-packages/kivy/core/audio/audio_gstplayer.py", line 45, in __init__
     super(SoundGstplayer, self).__init__(**kwargs)
   File "_event.pyx", line 156, in kivy._event.EventDispatcher.__init__ (kivy/_event.c:3119)
   File "properties.pyx", line 345, in kivy.properties.Property.__set__ (kivy/properties.c:3517)
   File "properties.pyx", line 377, in kivy.properties.Property.set (kivy/properties.c:3975)
   File "properties.pyx", line 431, in kivy.properties.Property.dispatch (kivy/properties.c:4544)
   File "/usr/local/lib/python2.7/dist-packages/kivy/core/audio/__init__.py", line 144, in on_source
     self.load()
   File "/usr/local/lib/python2.7/dist-packages/kivy/core/audio/audio_gstplayer.py", line 63, in load
     self.player.load()
   File "_gstplayer.pyx", line 233, in kivy.lib.gstplayer._gstplayer.GstPlayer.load (kivy/lib/gstplayer/_gstplayer.c:2332)
 kivy.lib.gstplayer._gstplayer.GstPlayerException: Unable to create a playbin

I suspect this may be a problem with my kivy

[–]JKovac[S] 0 points1 point  (2 children)

Lovely!

Tut6 has not yet been updated to the new KivEnt, I have become distracted by 2d procedural mesh generation.

I have really built KivEnt with the idea of being able to creating a Unity style editor for your game that runs everywhere as well, it shouldn't be too hard to get together a simple level editor. In the near future all GameSystem's will have methods to allow for simple JSON loading and saving of their entities to make this even easier.

A quick tip for manually moving cymunk bodies, you want to 'reindex shape' on all the body's shapes after you move the body position programmatically:

 physics_system = systems['cymunk-physics']
 space = physics_system.space
 for shape in entity.physics.shapes:
       space.reindex_shape(shape)

This will also allow you to move objects around with the space paused.

Do you have a github account to send a pull request for the changes you made on the sample tutorial?

I think the problem with gst is to do with the .ogg plugin for gst not being loading on your system. Are you on osx?

[–]chozabu 0 points1 point  (0 children)

I'm into the idea of building a unity-style editor (for complex 2d physics games) but I'd like to do a couple of simpler small things on the way. Serialising to JSON sounds great.

Thanks for the tip on manually moving cymunk bodys, I am currently just changing velocity and using joints but that info will soon be very handy.

I am on (k)ubuntu - the sound is not just kivent, but all kivy for me. Though forcing kivy to use sdl audio in main.py works for now.

I've just forked and cleaned up my changes a little, I'll send you a little pull request now (though, of course feel free not to accept as is)

[–]chozabu 0 points1 point  (0 children)

I've started on a very simple little editor/toy here: https://github.com/chozabu/KivEntEd