-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCHANGELOG-PREV.txt
More file actions
3369 lines (3089 loc) · 178 KB
/
Copy pathCHANGELOG-PREV.txt
File metadata and controls
3369 lines (3089 loc) · 178 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
* 5.36
** [Pro] [iOS] Default audio volume set to 40% on iOS (iPhone speakers are loud).
** [Pro] [iOS] Deploying to the simulator does not require =metadata/ios_metadata.txt= to be filled out.
** [Support] Better drift correction of the fixed-update simulation thread.
** [Support] Framerate calculation is recomputed on `$gtk.reset` or when the Console is closed.
** [Support] Orientation for game can be set to "both".
This is an initial cut and should be used for testing only. Setting the ~orientation~
to ~landscape,portrait~ or ~portrait,landscape~ will automatically change the orientation of
your game based on the width/height ratio of the window. The value that is specified first
signifies the starting orientation of your game.
** [Samples] Added sample app that shows how to calibrate a rhythm based game.
Sample app location: =samples/07_advanced_audio/03_rhythm_game_calibration=
** [A11y] A11y emulation can be controlled via gamepad.
** [Bugfix] Printing ~OpenEntities~ with recursive references no longer causes a stack overflow.
* 5.35
** [Samples] Added sample app that demonstrates how to create particles.
Sample app location: =samples/03_rendering_sprites/05_particles=
** [Support] Added ~FFI::Misc#setclipboard~ (accessible via ~gtk.ffi_misc~).
** [Support] ~Inputs#last_active~ set to a reasonable default value based on platform.
** [Bugfix] Inputs#finger_(left|right) reports correct locations when in portrait mode.
** [Bugfix] Improved ~Runtime#calcstringbox~'s accuracy improved for ~size_px:~ parameter.
** [Bugfix] Named parameters are respected for ~Geometry::line_to_rect~.
** [Bugfix] ~Layout#rect~ returns correct values after ~Runtime#toggle_orientation~ has been invoked.
** [Bugfix] DR class macros moved to ~Module~ from ~Object~.
* 5.34
** [Pro] [iOS] Deploying to the simulator no longer requires a provisioning profile.
Deploying to the device can be done through the Console, but requires provisioning profiles
create from https://developer.apple.com:
#+begin_src ruby
$wizards.ios.start env: :dev
#+end_src
You can deploy to the simulator without a provisioning profile:
#+begin_src ruby
$wizards.ios.start env: :sim
#+end_src
Additional details for iOS deployment available via ~help~:
#+begin_src ruby
$wizards.ios.help
#+end_src
** [Pro] [iOS] General improvements to A11y emulation to support VoiceOver functionality on iOS.
** [Support] Added ~Geometry::each_intersect_rect~ (many to many collision).
~Geometry::each_intersect_rect~ executes a callback for each collision found.
Example:
#+begin_src ruby
rects_1 = [{ x: 0, y: 0, w: 100, h: 100 }]
rects_2 = [{ x: 50, y: 50, w: 100, h: 100 }]
args.geometry.each_intersect_rect(rects_1, rects_2) do |rect_1, rect_2|
# do something with the intersecting rectangles
end
#+end_src
The following sample app has been updated to leverage the new function:
=samples/09_performance/09_collision_limits_many_to_many=
See docs for more info: https://docs.dragonruby.org/#/api/geometry?id=each_intersect_rect
** [Support] Rendering performance improvements for classes that use the ~attr_sprite~ class macro.
If a class uses ~attr_sprite~, DragonRuby will assume that sprite properties are provided via
iVars and will pull those values directly instead of invoking methods.
** [Support] Initial cut of ~$gtk.reboot~.
Invoking ~$gtk.reboot~ will reset your game as if it were started for the first time. Any
methods that were added to classes during hotload will be removed (leaving you with a pristine
environment). This function is in a beta state (report issues on the Discord Server).
** [Bugfix] Console no longer shown for method missing exceptions that have been handled.
* 5.33
** [Pro] [iOS] iOS wizard respects ~orientation_ios~ override if specified in =metadata/game_metadata.txt=
** [Pro] [Support] ~$gtk.set_window_scale~ accepts optional aspect ratio.
See docs for usage details: https://docs.dragonruby.org/#/api/runtime?id=set_window_scale
This is useful for testing different aspect ratios and how it'll
render when ~hd_letterbox=false~ (All Screen Mode).
** [Bugfix] Exceptions within ~boot~ presents the Console instead of segfaulting.
** [Support] Analog deadzone increased from 1600 to 3200.
Steam OS's default deadzone is 8192 which has been criticized for
being too damn high and a value of 1600 is below the minimum value
that the Steam Deck/Steam OS supports. After testing multiple
controllers, values below 3200 turned out to be too sensitive and
resulted in unintended anolog activity.
** [Support] ~args.outputs.watch~ added as an alias to ~args.outputs.debug.watch~.
** [Support] Class level ~Array~ methods added.
Here are some benchmarks of the Class level methods vs Instance
level methods:
- ~Array.compact!~: 2250% faster
- ~Array.compact~: 2075% faster
- ~Array.flat_map~: 918% faster
- ~Array.map~: 196% faster
- ~Array.find_all~: 141% faster
- ~Array.select~: 141% faster
- ~Array.filter_map~: 93% faster
- ~Array.map!~: 85% faster
- ~Array.select!~: 72% faster
- ~Array.reject~: 59% faster
- ~Array.reject!~: 47% faster
NOTE: These functions are still somewhat experimental and do not
conform to the ~Enumerable~ interface and may not support
all the capabilities that instance-based functions
have (they are also a bit more cumbersome to chain).
** [Support] Added aliases for common easing/lerping functions.
See docs for usage details: https://docs.dragonruby.org/#/api/easing?id=easinglerping
- ~Easing.smooth_start~
- ~Easing.smooth_stop~
- ~Easing.smooth_step~
- ~Easing.mix~
* 5.32
** [Pro] [Android] API 34 support added.
Target SDK for Android bumped to API 34 (Google Play compliance). NDK dependency upgraded to r26d.
** [Pro] [Support] Added ability to change your game's HD Max Scale and HD Letterbox while the game is running.
The following functions are accessible via ~$gtk~, ~GTK~, or ~args.gtk~:
- ~set_hd_max_scale(integer)~
- ~toggle_hd_letterbox~, ~set_hd_letterbox(bool)~
Details located in docs under Runtime -> Window Functions: https://docs.dragonruby.org/#/api/runtime?id=window-functions
** [Pro] [Bugfix] Fixed behavior of ~game_metadata.hd_max_scale~ for non-standard device resolutions.
** [Pro] [Support] Grid's ~allscreen_*~ properties are more accurate.
** [Pro] [Android] [Support] Removed size limitations of render targets (sprites must still be under 4000x4000 for Android).
** [Support] Various window and rendering specific functions have been added.
The following functions are accessible via ~$gtk~, ~GTK~, or ~args.gtk~:
- ~maximize_window~
- ~toggle_orientation~, ~set_orientation(bool)~
- ~move_window_to_next_display~
- ~toggle_orientation~, ~set_orientation(symbol)~
Details located in docs under Runtime -> Window Functions: https://docs.dragonruby.org/#/api/runtime?id=window-functions
** [OSS] ~require~ and ~require_relative~ machinery have been open sourced.
Location: =docs/oss/dragon/runtime/require.rb=
** [Bugfix] ~require_relative~ works for =.rb= files that are not inside of a directory.
Special thanks to kfischer_okarin@discord for submitting a patch.
** [Support] Changed console output terminal colors to use non-bright ansi escape sequences.
** [Support] In-Game webserver disabled by default.
The in-game web server is disabled by default. To enable it, update
=metadata/cvars.txt= in your game folder with the following:
# Enable the use of In-Game Web Server.
webserver.enabled=true
# Port that will be used for In-Game Web Server
webserver.port=9001
# Allow Remote Clients.
# only needs to be true if you want to accept client connections originating from
# sources other than localhost.
webserver.remote_clients=true
NOTE: For remote hotload to work, the webserver needs to be enabled, the ~port~ set to 9001,
and ~remote_clients~ must be set to ~true~.
* 5.31
** [Pro] [Android] Notes added to game_metadata.txt that packageid is required for Android.
** [Pro] [Android] Controller configuration wizard disabled by default on Anroid (and iOS).
** [Support] More control over RNG when ~GTK.reset~ is invoked.
See docs for the ~reset~ function under Runtime -> Top Level Functions.
** [Support] Statements evaluated in the Console will show object's ~.inspect~ representation as opposed to ~.to_s~.
** [Support] A ~LoadError~ will be raised if an exception occurs during ~require~.
** [Support] ~Grid.allscreen_(x|y|w|h)~ provide logical pixel values in both HD and SD modes.
This is useful for resizing/positioning a render target that has an aspect ratio other
than 16:9 (eg: a lowrez game with an aspect ratio of 1:1).
** [Bugfix] ~args.inputs~ related to attributes where the shift key is held are reported correctly.
Method aliasing and NumLock status were affecting these attributes.
** [Bugfix] Input for replays of recorded gameplay were off by one frame.
** [Samples] Added platformer sample app that demonstrates AABB collision, camera movement, plus in-game map editor.
Sample app location: =samples/99_genre_platformer/map_editor=
* 5.30
** [Support] Added ~Grid#landscape?~ and ~Grid#portrait?~
These are helper methods which check ~Grid.orientation == :landscape~
and ~Grid.orientation == :portrait~.
** [Support] Added windowing helper functions.
- ~$gtk.can_resize_window?~
- ~$gtk.can_close_window?~
- ~$gtk.toggle_window_fullscreen~
** [Support] ~$gtk.set_window_scale~ centers window after setting the window scale.
** [Support] References to ~args.state.tick_count~ updated to ~Kernel.tick_count~
While ~args.state.tick_count~ will continue to be supported, it is recommeded to use
~Kernel.tick_count~ instead. Sample apps and docs have been updated to use ~Kernel.tick_count~.
** [Support] Better validation/error messages for invalid primitives sent to ~args.outputs~.
This should reduce segfaults related to sending objects that can't be rendered.
* 5.29
** [Pro] [Support] [iOS] [Android] Game's orientation can be overridden for mobile platforms.
Example:
#+begin_src
# orientation for desktop/web
orientation=landscape
# if the following entries are provided, the orientation will be overridden
orientation_android=portrait
orientation_ios=portrait
#+end_src
** [Support] ~$gtk.notify~ takes into consideration whether remote hotloading is enabled.
Notifications will come through if remote hotloading is enabled even in production builds.
** [Support] ~Layout.debug_primitives~ renders additional seperators to help with alignment.
Example of how to show Layout debug primitives:
#+begin_src ruby
def tick args
if args.state.tick_count == 0
args.outputs.static_primitives << Layout.debug_primitives
end
end
#+end_src
** [Bugfix] Fixed issue of simulation loop running "catch up" ticks causing the game to inadvertantly speed up.
This is a regression that was introduced in v5.18.
** [Bugfix] Fixed issue where ~$gtk.create_uuid~ would return the last generated UUID on a subsequent invocation.
** [OSS] ~GTK::Outputs~ and ~GTK::Runtime::CBridge~ have been open sourced.
* 5.28
** [Indie] [Pro] [Support] Triangle primitives accept ~r, g, b, a~ for point.
#+begin_src ruby
def tick args
args.outputs.primitives << {
x: 0, y: 0,
source_x: 0, source_y: 0,
r: 255, g: 0, b: 0, a: 255,
x2: 0, y2: 100,
source_x2: 0, source_y2: 100,
r2: 0, g2: 255, b2: 0, a2: 64,
x3: 100, y3: 0,
source_x3: 100, source_y3: 0,
r3: 0, g3: 0, b3: 255, a3: 32,
path: :pixel
}
end
#+end_src
** [Support] Added ~$gtk.create_uuid~ that returns a ~String~.
NOTE: This function does not generate cryptographically secure UUIDs.
** [Support] [OSS] Function keys, and numpad keys added ~args.inputs.keyboard~.
Thank you to Hiro@discord for adding this functionality. Thank you
Podo@discord for testing.
** [Samples] Added sample app that demonstrates how to create a scroll view.
Sample app location: =samples/09_ui_controls/03_scroll_view=
** [Bugfix] Inner exception is captured if a file raising an exception during ~require~.
** [Bugfix] Ensure that ~require~ doesn't require the same file multiple times on the same tick.
* 5.27
** [mRuby] [Bugfix] Incoporated fix: Array#shuffle(!) result distribution #6227
https://github.com/mruby/mruby/pull/6227
Patch info located at =./docs/oss/mruby/dragonruby-mruby-3.patch=
Congrats to levi@discord for this getting merged into mRuby!
Special thanks to Pineapple@discord for creating a minimum repro to verify fix in DR.
* 5.26
** [Pro] [iOS] Initial cut of accessibility APIs that interact with iOS's VoiceOver capabilities.
A sample app has been created showing the release candidate api.
=./samples/09_ui_controls/04_accessiblity_for_the_blind/=
These accessibility functions will be expanded to cover more platforms over time and will be
available at all License tiers.
Users on the Standard License can run this sample app which will emulate iOS VoiceOver behavior by
posting notification entries during dev mode.
Pro users can release to their device and enable VoiceOver to demo the fully integrated experience.
To use VoiceOver on your iOS device:
1. Deploy app to device.
2. Say "Hey Siri, enable voice over.".
3. Make a capital Z gesture using two fingers to dismiss Siri.
4. Swipe left or right to navigate to your app.
5. Double tap to open your app.
6. Swipe left and right to navigate within your app.
7. Double tap accessibility elements and a click event will be issued.
** [Pro] [Bugfix] Fixed letterbox background color rendering for games that have ~hd_max_scale~ set to a non-zero value.
** [Pro] [Android] AndroidManifest.xml updated to be in compliance with Google Play Pass requirements.
** [Support] Added top level function ~shutdown~ which will be invoked before your game exits.
There are four top level functions that DragonRuby will be aware of:
- ~tick~: Your game loop.
- ~boot~: Invokes once when your game starts up.
- ~reset~: Invoked before ~$gtk.reset~ occurs.
- ~shutdown~: Invoked before your game exists.
See docs API -> Runtime -> Top Level Functions documentation for detailed explanations.
** [Bugfix] ~$gtk.calcstringbox~ respects ~size_enum:~ named parameter.
* 5.25
** [Pro] [iOS] Added new collection of icons that cover new devices.
** [Pro] [Android] [Bugfix] Fixed warning message about sprites being too large for Android to load.
** [Support] Added support for ~ignore_directories~ to =game_metadata.txt= which will not be packaged during ~dragonruby-publish~.
A comma delimited list of directories that should be ignored during the
publishing process. For example, if your game supports saves, you'd want to ignore
that directory (example format: ignore_directories=tmp,saves,dev,assets).
IMPORTANT:
Any directory that matches the ignore list will be ignored (REGARDLESS OF HIERARCHY).
For example:
ignore_directories value: saves
Directory structure:
- mygame
- saves <---- This directory will be ignored
- libs
- saves <---- This directory will be ignored
ignore_directories=saves
** [Support] Controllers now have a ~name~ property that will be set when a controller is connected.
** [Support] Removed custom overrides of ~const_defined?~ and ~const_missing~ (no longer needed).
** [Support] ~Geometry::rect_navigate~ left right wrapping behavior improved.
** [Support] ~Runtime#calcstringbox~ supports ~size_px~ via a named parameter.
** [Support] Source code backups now organized under =YYYY-MM-DDDD= directories.
** [OSS] ~Runtime#platform?~, ~Runtime#platform?~, and ~Runtime#platform_mappings~ open sourced.
** [Bugfix] ~Inputs#up_down_perc~ consults WASD/has parity with ~Inputs#left_right_perc~.
* 5.24
** [Pro] [Android] Fixed IP Address retrieval for remote hotload on Window.
** [Support] ~$gtk.notify! STRING~ respects new lines and will increase height accordingly.
** [Samples] Added sample app that shows how to create a radial menu that works with mouse and controller.
Sample app location: =samples/09_ui_controls/03_radial_menu=
** [Bugfix] Reverted experimental terminal stdin/stdout for MacOS and Linux.
* 5.23
** [Pro] [Support] Improved documentation for All Screen Mode.
** [Pro] [Indie] [Shaders] A beta of ~dragonruby-shadersim~ has been released.
Login and download at dragonruby.org.
The Keeper tech demo [https://youtu.be/xEqggoZoYAo] is the main sample app that ships with DragonRuby ShaderSim.
** [Pro] [Indie] [Shaders] Documentation added for shaders API.
** [Support] Docsify version of docs can now be run locally.
You can now view the docs offline using ~./dragonruby-httpd ./docs~
** [Support] ~args.outputs.debug~ when given a String is newline aware.
#+begin_src ruby
def tick args
# two watch labels will be generated given the newline character
args.outputs.debug << "hello\nworld"
end
#+end_src
** [Support] Added ~args.outputs.debug.watch(o, label_style:, background_style:)~
~args.outputs.debug~ has a ~watch~ function which lets you pass in a non-string value
and optional ~label_style:~, and ~background_style~ named parameters.
#+begin_src ruby
def tick args
args.state.enemies ||= 10.map do |i|
{
x: rand(1280),
y: rand(720),
w: 100,
h: 100
}
end
args.outputs.debug.watch pretty_format(args.state),
label_style: { r: 0,
g: 0,
b: 255,
size_px: 10 },
background_style: { r: 0,
g: 255,
b: 0,
a: 128,
path: :solid }
end
#+end_src
** [Support] Replay captures textinput events.
Recordings created via ~$recording.start_recording~ or via the
DragonRuby Console's "Record Gameplay" button now populate ~args.inputs.text~.
** [Support] Ctrl+R will stop a replay that is currently running.
** [Support] ~$gtk.reset_and_replay~ now takes in an optional implicit block.
The implicit block can be used to provide debug information during a replay execution.
#+begin_src ruby
def tick args
args.state.player ||= {
x: 100,
y: 100
}
if args.inputs.keyboard.key_down.space
args.state.player.x += 1
args.gtk.notify! "space pressed!"
end
end
# implicit block is called after tick is completed.
$gtk.reset_and_replay "replay.txt", speed: 1 do |args|
if args.state.player.x != 100
puts args.state.player.x
end
end
#+end_src
** [Bugfix] Warning for sprites greater than 1600x1600 correctly prints sprite path.
* 5.22
** [Support] [Pro] ~$wizards.ios.start~ sends build output immediately to standard out.
** [Support] Added ~Geometry::rect_navigate~ to support the navigation of menus using the keyboard/dpad.
Sample app demonstrating menu navigation added at =./samples/09_ui_controls/02_menu_navigation=.
** [Support] ~Geometry::center~ supports rects and lines.
~Geometry.center~ check to for w/h properties to determine if center point
computation should occur for a rect or a line.
** [Support] Added ~args.inputs.keyboard.key_(up|down|held).directional_vector.
** [Support] SDL_SetHint(SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS, "1") enabled.
** [Support] Warnings added for render targets and sprites above 1600x1600 pixels.
Android has a hard limit 4096x4096 for textures. A warning has been added to let you know
if you are exceeding this limit. Androids max hd scaling is also capped at 1800p (scale 2.5x).
Browser games opened on Android's mobile browser are also capped at 1800p with HighDPI disabled
to prevent skewing of aspect ratios.
** [Support] Warning is presented if ~:[]~ is invoked on an Entity, use ~.~ accessor instead.
** [Support] ~$gtk.delete_file~ checks to see if file exists before attempting to delete it.
** [Support] Docs migrated to use Docsify.
=./docs= directory contains markdown files. One page version of docs moved to =./docs/static=.
Special thanks to Redspark@discord and f_3r@discord for providing a Docsify proof of concept.
** [Bugfix] [mRuby] Fixed bug in Enumerable gems.
Exception would be raised for some functions on classes that override ~==~. Patch information
is located at =./docs/oss/mruby/dragonruby-mruby-2.patch=
Special thanks to jujule@discord, kfischer_okarin@discord, and levi@discord for troubleshooting
and finding a fix to mRuby gems.
** [Bugfix] ~Ctrl+R~ to reset game works even if Console is open.
** [Bugfix] ~args.inputs.last_active~ set to ~:mouse~ if touch event occurs.
** [Bugfix] ~args.inputs.(left_right|up_down) checks key_down states instead of key_up states.
** [Bugfix] Added ~args.inputs.up_down_directional_perc~ to compliment ~left_down_directional_perc~.
~left_down_directional_perc~ was flattered by the compliment.
* 5.21
** [Support] ~args.grid~ and ~args.layout~ can be accessed as a singleton via class functions.
Instead of calling ~$args.layout.rect~ or ~$args.grid.w~, you can now do ~Layout::rect~ or
~Grid::w~. Top level class functions forward to ~$args~. This is an initial cut and
all functions may not be forwarded.
** [Support] ~args.gtk~ functions can be accessed as a singleton via class functions.
Instead of calling ~$gtk.reset~, you can now do ~GTK::reset~. Top level class
functions forward to ~$gtk~. This is an initial cut and all functions may not be forwarded.
** [Support] Initial work for ~args.events.raw~
Property is an array of hashes ray representing all events from SDL occurred during a tick.
Mapping of all event types is pending. This is primarily used for debugging/observing what
could potential be codified into args.inputs.
** [Bugfix] Fixed exception when hotloading a file which includes a call ~$gtk.reset~.
Thanks to akzidenz@discord for reporting this issue.
** [Support] Better descriptions in ~$gtk.benchmark~ plus ~duration~ override.
~$gtk.benchmark~ now supports either passing in ~interations:~ or
~durations:~ in seconds. If ~iterations~ is passed in then the
winner is decided based on time to complete target iterations. If
~duration~ is passed in then winner is determined based on number
of iterations completed within the ~duration~ provided.
* 5.20
** [Bugfix] Fixed scenario where audio synchronization could throw an unhandled exception.
** [Support] DragonRuby version is logged to the console on startup.
* 5.19
** [Pro] [Bugfix] [iOS] [Android] Remote hotload fixed.
** [Support] Added ~args.inputs.keyboard.key_(down|held|up).keycodes~.
The ~keycodes~ attribute returns a ~Hash~ where the key is the SDL keycode and the value is the
~tick_count~. This contains all keycodes providing you access even if we don't have a named attribute.
For a list of all keycodes, see: https://wiki.libsdl.org/SDL2/SDLKeycodeLookup
** [Support] Added ~args.inputs.keyboard.key_(down|held|up).ac_back~
The ~ac_back~ key represents the "Application Control Back Button" on Android Devices.
** [Support] Added ~args.gtk.set_window_title(string)~.
This function takes in a string updates the title of the game in the Menu Bar.
Note: The default title for your game is specified in via the ~gametitle~ property in ~mygame/metadata/game_metadata.txt~.
** [Samples] Added sample app that shows off how an alchemy game can be created.
Sample app location: =samples/99_genre_crafting/alchemy_starting_point=
** [Bugfix] Fixed clipping of sound volume for very short sound effects.
** [Bugfix] Removed divergent behavior of web builds which marked render_targets as ~transient!~ by default.
Render targets by default are cached by DragonRuby. This allows for the texture to be reconstituted
in the event a window is resized. If the render target you are creating it updated every frame, it's
important to mark the render_target as ~transient~ (you'll get a warning recommending to do this if we
detect consequtive updates to a render target).
** [Bugfix] ~args.outputs.background_color~ can accept a Hash with keys ~r~, ~g~, ~b~(, ~a~).
The ~a~ key of the hash will be ignored for the top level output.
** [Bugfix] [mRuby] Fixed arithmetic comparison errors in web builds for integers with values greater than 1 Billion.
For web builds the following returned ~true~ incorrectly:
#+begin_src
puts (1_073_741_824 < 1_000_000_000) # returned true in web builds, wtf?
#+end_src
The mRuby virtual machine was patched to fix this error.
** [OSS] Open Sourced parts of the engine are now packaged within the zip as seperate ruby files under ~./docs/oss~.
Given the number of files that have been open sourced, having a single ~./docs/oss.txt~ file was getting a bit too large.
** [OSS] Custom patches made to mRuby are now packaged within the zip under ~./docs/dragonruby-mruby.patch~.
The arithmetic bugfix that was made for web builds is included within this patch file for your reference.
* 5.18
** [Performance] Rendering sprites using hashes improved (in some cases it's 30% faster).
** [Performance] Experimental enumerable/hash apis added.
The following experimental apis have been added. While they don't have exact parity to
core lib apis, the can be up to 300% faster:
- Array::map(array) do ... end
- Array::map!(array) do ... end
- Array::each(array) do ... end
- Enumerable::find_all(enum) do ... end
- Hash::merge(h_1, h_2) do ... end
- Hash::merge!(h_1, h_2) do ... end
- Hash::find_all(h) do ... end
NOTE: These apis are class level functions (the instance level functions are left unchanged).
** [Bugfix] The default font.ttf correctly renders Cryllic characters.
A special thanks to kota@discord and funkyloverone@discord for troubleshooting and fixing the default font.
Unfortunately, this fix did increase the size to 3.1MB (which is still less than the core engine which clocks in at 4.2MB).
** [Bugfix] Exceptions are correctly reported if main.rb has exceptions on startup as opposed to presenting a blank screen.
** [Bugfix] ~Enumberable#sum~ moved to ~Array#sum~.
** [Bugfix] ~Geometry::(line|ray)_intersect~ no longer throws an exception if given parallel lines.
** [Bugfix] Sounds queued up on the same frame via ~args.audio~ and ~args.outputs.sounds~ are synchronized.
** [Support] ~$gtk.reset~ additionaly garbage collects render_targets.
NOTE: You can use ~$gtk.reset_sprite(rt_name)~ to garbage collect render_targets that you are no longer using.
* 5.17
** [Samples] Path-finding sample app added that shows a preview of a player's path around walls.
Sample app location: =samples/13_path_finding_algorithms/10_moveable_squares=
** [Samples] Bullet Heaven sample app added.
Sample app location: =samples/99_genre_arcade/bullet_heaven=
** [Support] Added Geometry#angle_turn_direction
~args.geometry.angle_turn_direction angle, target_angle~
Returns ~1~ or -1 depending on which direction the ~angle~ needs to
turn to reach the ~target_angle~ most efficiently. The angles are
assumed to be in degrees. ~1~ means turn clockwise, and ~-1~ means
turn counter-clockwise.
** [Support] Added Geometry#angle(start_point, end_point)
This is an alias to ~args.geometry.angle_to~.
** [Support] ~Numeric#frame_index~ accepts either ~count:~ or ~frame_count:~ for determining animation length.
If both are provided, ~frame_count~ will be used.
#+begin_src
def tick args
index = Numeric.frame_index start_at: 0,
frame_count: 7,
hold_for: 8,
repeat: true
args.outputs.sprites << {
x: 0,
y: 0,
w: 64,
h: 64,
source_x: 32 * index,
source_y: 0,
source_w: 32,
source_h: 32,
path: "sprites/misc/explosion-sheet.png"
}
end
#+end_src
** [Bugfix] ~Numeric#frame_index~ ~repeat_index:~ optional parameter resets correctly for animations with frames > 3.
See =samples/03_rendering_sprites/03_animation_states_2= for example usage.
* 5.16
** [Support] Increased precision of the percentage and raw values returned by controller left/right analog sticks.
** [Support] ~args.inputs.left_right~ consults WASD scancodes as opposed to keycodes.
More scancode values will be supported in the future. Docs have been updated to enumerate new scancode properties
and behavior.
** [Support] Web builds will automatically mute if the game doesn't have focus.
** [Samples] Added sample app that shows how to create a repeating texture.
Sample app location: =samples/07_advanced_rendering/02_render_targets_repeating_texture=
** [Samples] Sample apps will include preview videos over time to mirror https://samples.dragonruby.org (be sure to check out the website).
The preview videos are fairly small (trying to keep them to less than 500KB each).
** [Bugfix] Fixed the letter "S" glyph in lowrez.ttf.
** [Bugfix] Added polyfill for renamed/normalized keyboard properties for backwards compatability with keyboard libraries.
** [Bugfix] ~$gtk.set_window_scale~ invalidates font textures so they can be redrawn at the new window size.
* 5.15
** [Pro] [iOS] [Bugfix] Fixed issue where game would crash after tomb-stoned for an extended period of time.
** [Pro] [iOS] [Bugfix] Fixed remote hotloading to device when app is signed with developer provisioning profile.
** [Bugfix] Keyboard input changes are reported correctly when modifier keys are exclusively pressed, held, or released.
* 5.14
** [Pro] [iOS] Warnings added if thermal state of the device increases above "fair".
This will be expanded to support more platforms.
** [Bugfix] DR starts up correctly even if =app/main.rb= contains syntax errors.
Syntax errors will be shown in the console on startup.
** [Bugfix] Fixed placement of summary information for ~args.layout.debug_primitives~.
** [Samples] Dueling Starships sample app cleaned up.
Sample app location: =./samples/99_genre_arcade/dueling_starships=
** [Support] Warning of file names containing capital letter/spaces will not show up in production.
** [Support] Adding warnings related to Array based primitives containing nested arrays/hashes.
While DR allows for this (is helpful for quick debugging), it's expensive to flatten
these jagged data structures.
NOTE: To audit your codebase of array based primitives usage, add ~$gtk.warn_array_primitives!~
to the bottom of =app/main.rb= (outside of your ~tick~ method).
* 5.13
** [Pro] [iOS] [Bugfix] iOS remote hotload continues to query for new code updates regardless of current exceptions.
** [Pro] [Android] minSDKVersion has been dropped to API 26 with targetSDKVersion set to 31.
This change is in compliance with Google and expands the devices that can run DR games.
** [Bugfix] dragonruby-publish updated to write marker files that aren't screaming caps.
** [Bugfix] Removed unnecessary parameter from ~Geometry::line_angle~.
** [Bugfix] Intermittent re-rendering of an already rendered frame no longer occurs.
You should see a reduction of checker box render_targets (that have been defined)
and a reduction in "studders" on high refresh rate monitors.
** [Bugfix] Hash methods that have been deprecated now get reported in logs.
This also fixes an issue with using these deprecated methods with compile_ruby=true.
** [Bugfix] ~$gtk.reset_and_replay~ starts replay on the correct frame.
Replays invoked via this fucntion are no longer shifted by one frame.
** [Bugfix] Mouse grab configuration is reinitialized if a game enters or leaves fullscreen mode.
Setting mouse grab and then entering/leving fullscreen mode no longer restricts mouse
movement to the previous window size.
* 5.12
** [Pro] [Android] minSdk for Android APK exports lowered to API 30.
Lowering the minSdk for APK export ensures compatibility with
Retroid Pocket (which is a great test device).
NOTE: The Google Play export remains unchanged (minSDK 31) to ensure
compliance with game submission requirements.
** [Pro] [Bugfix] ~args.grid.offset_(x|y)~ reports correct values when your game metadata has ~hd_letterbox~ set to ~false~.
** [Samples] Bouncing ball sample app reworked/simplified.
Sample app location: =samples/04_physics_and_collisions/11_bouncing_ball_with_gravity=
** [Support] New geometry functions + docs added (extracted from bouncing ball sample app).
- Geometry::line_angle
- Geometry::vec2_dot_product
- Geometry::vec2_normalize
- Geometry::line_vec2
- Geometry::vec2_magnitude
- Geometry::distance_squared
- Geometry::vec2_normal
- Geometry::circle_intersect_line?
- Geometry::line_normal
- Geometry::point_on_line?
** [Support] args.audio.volume added.
All sounds for your game can be globally controlled via the ~args.outputs.volume~
property (float value between 0.0 and 1.0).
** [Support] CTRL+R resets game.
Pressing CTRL+R will invoke ~$gtk.reset_next_tick~ and is now baked-in (so you don't
have to code this functionality in every game).
** [Support] "Quick Watch" via ~args.outputs.debug~.
~args.outputs.debug~ allows you to pass in a ~String~ as a primitive. This is helpful for quickly showing the
value of a variable on the screen. A label with black text and a white background will be created
for each ~String~ sent in. The labels will be automatically stacked vertically for you.
Example:
#+begin_src
def tick args
args.state.player ||= { x: 100, y: 100 }
args.state.player.x += 1
args.state.player.x = 0 if args.state.player.x > 1280
# the following string values will generate labels with backgrounds
# and will auto stack vertically
args.outputs.debug << "current tick: \#{args.state.tick_count}"
args.outputs.debug << "player x: \#{args.state.player.x}"
end
#+end_src
If you want something more fully-featured, check out Palantir: https://kfischer-okarin.itch.io/palantir
** [Support] T-Pose placeholders sprites added to zip.
** [Support] Warnings added if file paths contain spaces or capital letters (xplat compatibility guarantees).
** [Support] Nintendo Switch Pro Controller mappings added/are now built-in.
** [Docs] Syntax highlighting added to code examples.
** [Bugfix] Setting your sprite path to ~:solid~ (an alias for ~:pixel~) no longer warns that it must be marked as ~transient!~.
** [Bugfix] Web builds automatically mark all render targets as ~transient!~.
Non-transient render targets causes durable caching of the texture and is needed if the
game is resized while running under DirectX. This is not needed for web builds (and may not be
needed for Mac/Linux builds, but further testing needs to be done).
* 5.11
** [Samples] Added sample app that shows how to implement a clipping of a sprite.
Sample app location: =samples/07_advanced_rendering/01_render_targets_clip_area=
** [Bugfix] Audio was not looping in web builds. This has been fixed.
** [Bugfix] ~args.inputs.keyboard.key_held.char~ has parity with ~.key_(up|down).char~.
NOTE: ~args.inputs.keyboard.key_held.char~ will only return the ascii value
of the last key that was held. Use ~args.inputs.keyboard.key_held.truthy_keys~
to get an ~Array~ of ~Symbols~ representing all keys being held.
To get a picture of all key states ~args.inputs.keyboard.keys~ returns a ~Hash~
with the following keys: ~:down~, ~:held~, ~:down_or_held~, ~:up~.
This is a demonstration of the behavior (see =./samples/02_input_basics/01_keyboard= for a more detailed example):
#+begin_src
def tick args
# uncomment the line below to see the value changes at a slower rate
# $gtk.slowmo! 30
keyboard = args.inputs.keyboard
args.outputs.labels << { x: 30,
y: 720,
text: "use the J key to test" }
args.outputs.labels << { x: 30,
y: 720 - 30,
text: "key_down.char: #{keyboard.key_down.char.inspect}" }
args.outputs.labels << { x: 30,
y: 720 - 60,
text: "key_down.j: #{keyboard.key_down.j}" }
args.outputs.labels << { x: 30,
y: 720 - 30,
text: "key_held.char: #{keyboard.key_held.char.inspect}" }
args.outputs.labels << { x: 30,
y: 720 - 60,
text: "key_held.j: #{keyboard.key_held.j}" }
args.outputs.labels << { x: 30,
y: 720 - 30,
text: "key_up.char: #{keyboard.key_up.char.inspect}" }
args.outputs.labels << { x: 30,
y: 720 - 60,
text: "key_up.j: #{keyboard.key_up.j}" }
end
#+end_src
* 5.10
** [Support] [Pro] Support added for XCode 15.0, 15.1 Beta and MacOS Sonoma.
~$wizards.ios~ enhanced to automatically install a default device if none are present.
NOTE: If you are creating C Extensions for iOS, take note that a new linker
has been released with XCode 15.0 and may require you to add the following
compilation flags for your C Extension to work: ~-Wl,-undefined -Wl,dynamic_lookup~
** [Support] Added ~$wizards.itch.help~ and ~$wizards.ios.help~.
* 5.9
** [Support] [Pro] HD scaling "stretch to fit" has been added.
There are scenarios where a dev may prefer their HD game to fill the entire screen
instead of being pixel perfect. To set your game to be scaled to fit (while still
retaining a 16:9 aspect ratio) set the following properties inside of =./metadata/game_metadata.txt=:
#+begin_src
# enables hd mode
hd=true
# render the letterbox
hd_letterbox=true
# set the scaling to "stretch to fit"
hd_max_scale=0
#+end_src
A full explanation of the hd_max_scale property is available in =./metadata/game_metadata.txt=.
** [Support] [Pro] Added support for texture atlases for games at 1.75 scale (2240x1260)
See args.grid documentation for details of this new texture atlas.
** [Bugfix] Defining a top level method called ~event~ no longer causes an exception.
** [Support] ~args.layout.rect~ and ~args.layout.debug_primitives~ documentation added.
** [Support] ~args.layout.debug_primitives~ enhanced to provide more layout information.
* 5.8
** [Bugfix] Wasm/web builds with looping audio no longer crash.
* 5.7
** [Support] Added ~Geometry::find_all_intersect_rect_quad_tree~.
Function is useful if ~Geometry::find_all_intersect_rect~ doesn't meet performance needs
and if the rectangles that are checked do not change every frame. See docs for usage example.
** [Support] Better handling of fullscreen mode for web builds.
** [Bugfix] [mRuby] ~Hash~ double-splat format in mRuby 3.0 changed the original Hash. This has been fixed.
Special thanks to Sophira@discord and Pineapple@discord for finding and bumping the fix of this issue.
*** Repro:
#+begin_src
hash = { }
result = { **hash, a: 1, b: 2 }
puts result # { a => 1, b => 2 }
puts hash # Wrong: { a => 1, b => 2 } mRuby <3.2 (DragonRuby <5.7)
puts hash # Right: { } mRuby 3.2 (DragonRuby 5.7)
#end_src
*** Pertinent links that describe the issue in detail:
- https://github.com/mruby/mruby/commit/12d51807a397545d5cf423d2f9bd9b52b7e4a786
- https://github.com/mruby/mruby/pull/5640#issuecomment-1032674395
*** Performance of ~Hash~ double-splat vs ~merge~ vs ~merge!~
#+begin_src
def tick args
if args.inputs.keyboard.key_down.r
args.gtk.console.show
args.gtk.benchmark iterations: 100000,
merge: -> () {
a = { x: 0, y: 0, w: 100, h: 100 }
b = { r: 255, g: 255, b: 255 }
c = { anchor_x: 0.5, anchor_y: 0.5 }
d = { path: :pixel }
e = a.merge(b).merge(c).merge(d)
},
merge_bang: -> () {
a = { x: 0, y: 0, w: 100, h: 100 }
b = { r: 255, g: 255, b: 255 }
c = { anchor_x: 0.5, anchor_y: 0.5 }
d = { path: :pixel }
e = a.merge(b).merge!(c).merge!(d)
},
splat: -> () {
a = { x: 0, y: 0, w: 100, h: 100 }
b = { r: 255, g: 255, b: 255 }
c = { anchor_x: 0.5, anchor_y: 0.5 }
d = { path: :pixel }
e = { **a, **b, **c, **d }
}
end
end
* BENCHMARK RESULT: splat is fastest
** Iterations: 100000
** Fastest: splat
** Second: merge_bang
** Margin %: merge_bang was 465% slower than splat
** Margin ms: merge_bang took 723ms longer than splat (198ms vs 921ms)
** Times:
*** splat: 198ms (0% 0ms).
*** merge_bang: 921ms (465% 723ms).
*** merge: 993ms (502% 795ms).
#+end_src
* 5.6
** [Pro] [Android] Minimum target SDK increased to API 31 to stay in compliance with Google Play App submissions.
** [Pro] [BugFix] Nested required files are correctly loaded if ~compile_ruby=true~ for the game's metadata.
Thank you to dishcandanty@discord and drewhamlett@discord for repro and testing support.
** [Performance] ~args.geometry.find_all_intersect_rect rect, rects~ is 20% faster.
** [Docs] Docs added for ~args.audio[].(x|y|z)~ usage.
** [Support] ~$gtk.platform? key~ and ~$gtk.platform_mappings~ provides more granularity across platforms.
Example:
#+begin_src
def tick args
label_style = { x: 640, y: 360, anchor_x: 0.5, anchor_y: 0.5 }
if args.gtk.platform? :macos # other options :win, :linux, :web, :android, :ios
args.outputs.labels << { text: "I am running on MacOS.", **label_style }
elsif args.gtk.platform? :touch
args.outputs.labels << { text: "I am running on a device that supports touch (either iOS/Android native or mobile web).", **label_style }
elsif args.gtk.platform? :steam
args.outputs.labels << { text: "I am running via steam (covers both desktop and steamdeck).", **label_style }
elsif args.gtk.platform? :steam_deck
args.outputs.labels << { text: "I am running via steam on the Steam Deck (not steam desktop).", **label_style }
elsif args.gtk.platform? :steam_desktop
args.outputs.labels << { text: "I am running via steam on desktop (not steam deck).", **label_style }
end
end
#+end_src
For additional details, see docs.
** [Support] ~Numeric#frame_index~ now supports allows for a ~repeat_index:~ option.
The ~repeat_index~ option is helpful if your sprite animation has start frames that shouldn't be
considered if a loop of the animation occurs.
Example:
#+begin_src
def tick args
start_looping_at = 0
sprite_index =
start_looping_at.frame_index count: 5, # sprite animation contains 2 starting frames
hold_for: 4,
repeat: true,
repeat_index: 2, # start from index 2 on repeat
tick_count_override: args.state.tick_count
sprite_index ||= 0
args.outputs.sprites << [
640 - 50,
360 - 50,
100,
100,
"sprites/dragon-\#{sprite_index}.png"
]
end
#+end_src
** [Support] Added ~args.inputs.locale~.
The function returns the ISO 639-1 two-letter language code based on OS preferences (see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
** [BugFix] ~Numeric#idiv~ returns correct values for integer division of negative numbers.
Thank you to Ceph@discord for pointing out this oversight.
** [Samples] Added sample app that shows how to use the new ~repeat_index~ parameter on ~Numeric#frame_index~.
Sample app location: =samples/03_rendering_sprites/03_animation_states_intermediate=
* 5.5
** [Bugfix] [Support] Web builds hosted on Itch.io were not working in
Safari nor Chrome on Android. We found a work around for this.
** [Samples] Added sample app that shows how to use cameras in combination with a tactical grid.
Location of sample app: =./samples/07_advanced_rendering/16_camera_space_world_space_simple_grid_map=
* 5.4
** [Bugfix] ~outputs.static_primitives~ now correctly renders labels.
* 5.3
** [Support] ~require~ statements are now processed synchronously.
** [Support] ~require_relative~ added.
** [Bugfix] ~outputs.primitives~ checks for ~draw_override~ before looking for ~primitive_marker~.
* 5.2
** [Support] [Pro] [Indie] C Extensions can be used on WASM/Web builds.
$gtk.dlopen will look for assemblies under =mygame/native/emscripten-wasm=.
See Emscripten docs for compilation steps [[https://emscripten.org/docs/getting_started/downloads.html]].
** [Samples] Added sample app that shows how to convert from screen space to world space without using matricies.
Location of sample: =./samples/07_advanced_rendering/16_camera_space_world_space_simple=
NOTE: This is a **really** good foundation for building games with a camera that pans and zooms.
** [Support] Suppress framerate warnings after a recent =$gtk.reset= or =require= of a file.
** [Bugfix] Passing nested enumerables to ~args.outputs...~ no longer causes a segfault.
* 5.1
** [Support] Added ~Inputs#last_active~.
This function returns the last active input which will be set to either ~:keyboard~,
~:mouse~, or ~:controller~. The function is helpful when you need to present on screen
instructions based on the input the player chose to play with.
Example:
#+begin_src
def tick args
if args.inputs.last_active == :controller
args.outputs.labels << { x: 60, y: 60, text: "Use the D-Pad to move around." }
else
args.outputs.labels << { x: 60, y: 60, text: "Use the arrow keys to move around." }
end
end
#+end_src
** [Support] Added ~cvars~ attribute accessor to the ~attr_gtk~ class macro.
~args.cvars~ is now accessible at the top level if you mix in ~attr_gtk~.
Example:
#+begin_src
class Game
attr_gtk
def tick
# render a label with the game version
# (no need to prefix cvars with args)
outputs.labels << {
x: 640,
y: 360,
text: args.cvars["game_metadata.version"].value.to_s
}
end
end
def tick args
$game ||= Game.new
$game.args = args
$game.tick
end
def reset
$game = nil
end
#+end_src
** [Bugfix] [Pro] [iOS] Regress in ~$wizards.ios.start env: :sim~ has been resolved.
** [OSS] [Performance] More preformant ~Numeric#map(_with_index)~ and Numeric#each(_with_index).
Performance improvements made to ~NumericHmap~ and ~Numeric#each~. Special thanks to
levi@discord for contributing this optimization.
* 5.0
** [IMPORTANT] This release has minor breaking changes. They are trivial to resolve.
Come to the DragonRuby Discord Server and we'll help you work through any issues.
[[http://discord.dragonruby.org]].
Let's start with some good news before we get into breaking changes.
** [Support] Portrait orientation enabled for all license tiers.
In ~metadata/game_metadata.txt~, you can set ~orientation=portrait~ and DragonRuby will
be presented with a logical resolution of 720x1280.
*** Limitations/Differences between license tiers.
- The Standard and Indie tier's portrait resolution is fixed to 720p (with scaling).
- You will still need a Pro license to:
- Render your game in HD and High DPI.
- Leverage auto-discovery of Texture Atlases (Pro tier supports resolutions
from 720p all the way to 4K).
- Deploy your portrait (or landscape) game to a mobile device, AppStore, or Google Play.
- Render outside of the game's safe area (All Screen Mode).
I hope the ability to prototype a portrait game encourages y'all to upgrade to Pro
so you can play the games you've built on your phone (even potentially release to the AppStore and Google Play).
Okay, now for the breaking changes (don't panic).
** [BREAKING] ~Outputs#sounds~ no longer supports looping audio. Migrate to ~Args#audio~.
If you were passing ~.ogg~ values into ~args.outputs.sounds~, they will no longer loop.
All sounds passed into this collection will play once. Example:
#+begin_src
def tick args
if args.state.tick_count == 0
# bg music will not loop after completion
# use args.audio to create a looping (see below)
args.outputs.sounds << "sounds/bg-music.ogg"
end
end
#+end_src
If you want audio to loop, use ~args.audio~:
#+begin_src
def tick args
if args.state.tick_count == 0
args.audio[:bg_music] = { input: "sounds/bg-music.ogg", looping: true }
end
end
#+end_src
A warning message will be provided by DrangonRuby if we detect this breaking change.
** [BREAKING] Property based access in ~Hash#(x|x1|y|y1)~ no longer consults ~rect~, ~point~.
The following behavior of ~Hash#(x|x1|y|y1)~ was experimental and has been removed
(it's unlikely that you even used this/knew about it).
This is the ~Hash~ behavior in 4.x:
#+begin_src
some_hash = {
rect: {
x: 0,
y: 0,
w: 100,
h: 100
}
}
puts some_hash.x # -> 0
puts some_hash.x1 # -> 0
puts some_hash.rect.x # -> 0
#+end_src
This is the ~Hash~ behavior in 5.0:
#+begin_src
some_hash = {
rect: {
x: 0,
y: 0,
w: 100,
h: 100
}
}
puts some_hash.x # -> nil
puts some_hash.x1 # -> nil
puts some_hash.rect.x # -> 0
#+end_src
Keep an eye out for null reference exceptions and check to see if
you have a nested ~Hash~ with ~rect~ or ~point~ defined.
That's it for breaking changes.
** [Pro] [iOS] Device type can now be specified when deploying to the simulator.
~$wizards.ios.start~ now supports a ~:sim_name~ argument. If you don't provide one, your
game will be deployed to an iPhone 14 Simulator. Example:
#+begin_src
# this command is run in DragonRuby's Console
$wizards.ios.start env: :sim, sim_name: "iPad Pro (12.9-inch)"
#+end_src
To get available simulators, you can run the following command in a terminal window:
#+begin_src
# run this command in a terminal window (not DragonRuby's Console)
xcrun simctl list devices
#+end_src
A thank you goes out to death.au@discord for adding this capability.
** [Performance] Performance of property based access of ~Hash~ values improved by ~30%.
Expect to see a small improvement if you use attribute accessors to access
~Hash~ values (eg ~some_hash.x~ vs ~some_hash[:x]~).
** [Support] Framerate notification made less obtrusive and can be disabled.
The FPS warning messages have been modified to not show a wall of text in the console. You